From 178f3dc19ba0ec95de8f7d8b7806c0d5fd6f12d3 Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff Date: Wed, 4 Jun 2025 00:10:22 +0100 Subject: [PATCH 1/2] Fix issue --- changelog_entry.yaml | 4 ++++ policyengine_api/jobs/calculate_economy_simulation_job.py | 8 +++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..d787b3a05 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - V2 comparisons. diff --git a/policyengine_api/jobs/calculate_economy_simulation_job.py b/policyengine_api/jobs/calculate_economy_simulation_job.py index f74a1619a..1c45d6f09 100644 --- a/policyengine_api/jobs/calculate_economy_simulation_job.py +++ b/policyengine_api/jobs/calculate_economy_simulation_job.py @@ -215,11 +215,12 @@ def run( progress_log.model_dump(mode="json"), severity="INFO" ) except Exception as e: + trace = traceback.format_exc() # Send error log to GCP error_log: V2V1Comparison = V2V1Comparison.model_validate( { **comparison_data, - "v2_error": str(e), + "v2_error": trace, } ) logger.log_struct( @@ -266,7 +267,7 @@ def run( ) v2_country_package_version = api_v2_output[ - "country_package_version" + "model_version" ] completion_log: V2V1Comparison = ( @@ -310,11 +311,12 @@ def run( ) except Exception as e: + trace = traceback.format_exc() # If job fails, send error log to GCP error_log: V2V1Comparison = V2V1Comparison.model_validate( { **comparison_data, - "v2_error": str(e), + "v2_error": trace, "v1_impact": impact, "v2_impact": None, "v1_v2_diff": None, From 36200c22f94a817d592782e6b03fe295f3ad8727 Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff Date: Wed, 4 Jun 2025 00:10:30 +0100 Subject: [PATCH 2/2] Format --- policyengine_api/jobs/calculate_economy_simulation_job.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/policyengine_api/jobs/calculate_economy_simulation_job.py b/policyengine_api/jobs/calculate_economy_simulation_job.py index 1c45d6f09..a4d8dfdb5 100644 --- a/policyengine_api/jobs/calculate_economy_simulation_job.py +++ b/policyengine_api/jobs/calculate_economy_simulation_job.py @@ -266,9 +266,7 @@ def run( api_v2_execution ) - v2_country_package_version = api_v2_output[ - "model_version" - ] + v2_country_package_version = api_v2_output["model_version"] completion_log: V2V1Comparison = ( V2V1Comparison.model_validate(