From 31e1c43f0af068b49b0629ad2f6cf26586c2bdde Mon Sep 17 00:00:00 2001 From: Alex Galarce Date: Thu, 12 Jun 2025 16:39:03 +0000 Subject: [PATCH] Merged in feature/formatted-prov-info-json (pull request #574) Feature/formatted prov info json * Add newline and pipe-delimited formatting for provider info JSON * Add new investment column names for nicely-formatted PROV_INFO_JSON * remove PROV_INFO_JSON_PIPE and rename PROV_INFO_JSON_NEWLINE to PROV_INFO_JSON_FORMATTED * Merge remote-tracking branch 'origin/main' into feature/formatted-prov-info-json Approved-by: Katon Minhas --- fieldExtraction/src/constants/investment_columns.py | 3 +-- fieldExtraction/src/investment/file_processing.py | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/fieldExtraction/src/constants/investment_columns.py b/fieldExtraction/src/constants/investment_columns.py index f598c1d..41186f2 100644 --- a/fieldExtraction/src/constants/investment_columns.py +++ b/fieldExtraction/src/constants/investment_columns.py @@ -17,8 +17,7 @@ COLUMN_ORDER = [ "PROV_OTHER_NPI", "PROV_OTHER_NAME_FULL", "PROV_INFO_JSON", - "PROV_INFO_JSON_NEWLINE", - "PROV_INFO_JSON_PIPE", + "PROV_INFO_JSON_FORMATTED", "AARETE_DERIVED_EFFECTIVE_DT", "TERMINATION_DT", "AARETE_DERIVED_TERMINATION_DT", diff --git a/fieldExtraction/src/investment/file_processing.py b/fieldExtraction/src/investment/file_processing.py index 9d5614b..f70f816 100644 --- a/fieldExtraction/src/investment/file_processing.py +++ b/fieldExtraction/src/investment/file_processing.py @@ -80,9 +80,7 @@ def run_one_to_one_prompts(filename, contract_text, text_dict, top_sheet_dict, d one_to_one_results['PROV_INFO_JSON'] = json.dumps(regex_answers_dict) ## Easier formatting for customers: # Create newline-delimited version - one_to_one_results['PROV_INFO_JSON_NEWLINE'] = '\n'.join([json.dumps(provider) for provider in regex_answers_dict]) - # Create pipe-delimited version - one_to_one_results['PROV_INFO_JSON_PIPE'] = '|'.join([json.dumps(provider) for provider in regex_answers_dict]) + one_to_one_results['PROV_INFO_JSON_FORMATTED'] = '\n'.join([json.dumps(provider) for provider in regex_answers_dict]) one_to_one_results = merge_provider_info(one_to_one_results, regex_answers_dict)