From 54f7d07138c0e4a3c2db5ab161419729501adb05 Mon Sep 17 00:00:00 2001 From: "Ed (ODSC)" Date: Fri, 29 Nov 2024 14:32:40 +0000 Subject: [PATCH] process.py: Load schema for BODS 0.4 --- cove_bods/process.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cove_bods/process.py b/cove_bods/process.py index ab726a7..e5ec665 100644 --- a/cove_bods/process.py +++ b/cove_bods/process.py @@ -206,10 +206,12 @@ def process(self, process_data: dict) -> dict: if check_table_file_new(supplied_data_json_file): statement_id_name = "statementID" - schema_url = config['schema_versions']['0.2']['schema_url'] + schema = config['schema_versions']['0.2']['schema_url'] else: statement_id_name = "statementId" - schema_url = config['schema_versions'][config['schema_latest_version']]['schema_url'] + schema = schema_registry( + config['schema_versions'][config['schema_latest_version']]['schema_url'] + ).contents("urn:statement") unflatten_kwargs = { "output_name": os.path.join(output_dir, "unflattened.json"), @@ -218,7 +220,7 @@ def process(self, process_data: dict) -> dict: "id_name": statement_id_name, "root_is_list": True, "input_format": get_file_type_for_flatten_tool(supplied_data_json_file), - "schema": schema_url, + "schema": schema, } logger.info(f"{input_filename} {unflatten_kwargs}")