Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/microplex_us/pipelines/us.py
Original file line number Diff line number Diff line change
Expand Up @@ -8290,6 +8290,15 @@ def has_any(*columns: str) -> bool:
.astype(float)
.ne(0.0)
)
if (
"business_is_sstb" in result.columns
and "sstb_self_employment_income_would_be_qualified" not in result.columns
):
result["sstb_self_employment_income_would_be_qualified"] = (
pd.to_numeric(result["business_is_sstb"], errors="coerce")
.fillna(0.0)
.ne(0.0)
)
if "is_blind" in result.columns:
result["is_blind"] = (
pd.to_numeric(result["is_blind"], errors="coerce").fillna(0.0).ne(0.0)
Expand Down
1 change: 1 addition & 0 deletions src/microplex_us/policyengine/us.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ class PolicyEngineUSVariableMaterializationResult:
"ssi_reported": 0.0,
"ssn_card_type": "CITIZEN",
"sstb_self_employment_income_before_lsr": 0,
"sstb_self_employment_income_would_be_qualified": True,
"sstb_unadjusted_basis_qualified_property": 0.0,
"sstb_w2_wages_from_qualified_business": 0.0,
"strike_benefits": 0,
Expand Down
5 changes: 5 additions & 0 deletions tests/pipelines/test_us.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ def test_build_policyengine_entity_tables_derives_tax_input_columns(self):
"unemployment_compensation": [0.0, 150.0],
"medicaid": [0.0, 1_250.0],
"medicaid_enrolled": [False, True],
"business_is_sstb": [True, False],
"state_income_tax_paid": [400.0, 50.0],
"filing_status": ["JOINT", "JOINT"],
"relationship_to_head": [0, 1],
Expand Down Expand Up @@ -1030,6 +1031,10 @@ def test_build_policyengine_entity_tables_derives_tax_input_columns(self):
assert person_rows["social_security_retirement"].tolist() == [0.0, 800.0]
assert person_rows["ssi"].tolist() == [0.0, 600.0]
assert person_rows["takes_up_ssi_if_eligible"].tolist() == [False, True]
assert person_rows["sstb_self_employment_income_would_be_qualified"].tolist() == [
True,
False,
]
assert person_rows["taxable_private_pension_income"].tolist() == [0.0, 300.0]
assert person_rows["unemployment_compensation"].tolist() == [0.0, 150.0]
assert person_rows["is_female"].tolist() == [False, True]
Expand Down
1 change: 1 addition & 0 deletions tests/policyengine/test_us.py
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,7 @@ def __init__(self, entity):
"qualified_tuition_expenses",
"salt_refund_income",
"stock_assets",
"sstb_self_employment_income_would_be_qualified",
"taxable_ira_distributions",
"tip_income",
"unreimbursed_business_employee_expenses",
Expand Down
Loading