From 7de21fd203ad8ccc9bf75229727b8ac56e0e5999 Mon Sep 17 00:00:00 2001 From: Max Ghenis Date: Sat, 31 Jan 2026 17:09:46 -0500 Subject: [PATCH] Fix etl_state_income_tax.py API mismatches with db_metadata utils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SourceType.administrative → SourceType.ADMINISTRATIVE (enum is uppercase) - type= → source_type= (correct kwarg name) - get_or_create_variable_group: display_name → category (required param) - get_or_create_variable_metadata: variable_group_id → group, description → notes Co-Authored-By: Claude Opus 4.5 --- changelog_entry.yaml | 4 ++++ policyengine_us_data/db/etl_state_income_tax.py | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..0f77355eb 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - Fix etl_state_income_tax.py API mismatches with db_metadata utility functions diff --git a/policyengine_us_data/db/etl_state_income_tax.py b/policyengine_us_data/db/etl_state_income_tax.py index f3517836d..df0f40a6c 100644 --- a/policyengine_us_data/db/etl_state_income_tax.py +++ b/policyengine_us_data/db/etl_state_income_tax.py @@ -261,7 +261,7 @@ def load_state_income_tax_data(df: pd.DataFrame, year: int) -> dict: source = get_or_create_source( session, name="Census Bureau Annual Survey of State Tax Collections", - type=SourceType.administrative, + source_type=SourceType.ADMINISTRATIVE, url="https://www.census.gov/programs-surveys/stc.html", notes="Individual income tax collections by state", ) @@ -270,7 +270,7 @@ def load_state_income_tax_data(df: pd.DataFrame, year: int) -> dict: var_group = get_or_create_variable_group( session, name="state_income_tax", - display_name="State Income Tax", + category="taxes", description="State-level individual income tax collections", ) @@ -278,10 +278,10 @@ def load_state_income_tax_data(df: pd.DataFrame, year: int) -> dict: get_or_create_variable_metadata( session, variable="state_income_tax", + group=var_group, display_name="State Income Tax", - variable_group_id=var_group.variable_group_id, units="USD", - description="Total state individual income tax collections", + notes="Total state individual income tax collections", ) # Get geographic strata to use as parents