From 6efb889201a46cf2f1438b911a7a9952f604bc4c Mon Sep 17 00:00:00 2001 From: "Ed (ODSC)" Date: Fri, 29 Nov 2024 12:24:09 +0000 Subject: [PATCH] process.py: Guess schema for unflattening --- cove_bods/process.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cove_bods/process.py b/cove_bods/process.py index 957289c..f52efe5 100644 --- a/cove_bods/process.py +++ b/cove_bods/process.py @@ -202,10 +202,14 @@ def process(self, process_data: dict) -> dict: # We don't know what schema version the spreadsheet is in. Use default schema. schema = SchemaBODS() + config = LibCoveBODSConfig().config + if check_table_file_new(supplied_data_json_file): statement_id_name = "statementID" + schema = config['schema_versions']['0.2']['schema_url'] else: statement_id_name = "statementId" + schema = config['schema_versions'][config['schema_latest_version']]['schema_url'] unflatten_kwargs = { "output_name": os.path.join(output_dir, "unflattened.json"),