Remove SSTB/QBI compat shim, require policyengine-us 1.637.0#770
Merged
Conversation
policyengine-us 1.637.0 adds `sstb_self_employment_income`, `sstb_w2_wages_from_qualified_business`, `sstb_unadjusted_basis_qualified_property`, `sstb_self_employment_income_would_be_qualified`, `sstb_qualified_business_income`, `total_self_employment_income`, and the SSTB-aware QBI formulas as first-class variables (PR #7944). The data package no longer needs to backfill them. Bump the `policyengine-us` floor to `>=1.637.0`, delete the `ensure_policyengine_us_compat_variables` monkey-patch and its three call sites, and drop the compat-specific unit tests that validated the shim's SSTB variable registration and QBID arithmetic — those behaviors are now covered by policyengine-us's own test suite. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
a669a36 to
18ac5b9
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Collapse the two-sided SSTB/QBI implementation that landed across #701 (data) and policyengine-us#7944 (model). With policyengine-us 1.637.0 shipping the SSTB inputs and formulas natively, the compat shim in
policyengine_us_data/utils/policyengine.pyno longer has a job to do.policyengine-usfloor from>=1.572.5to>=1.637.0and regeneratesuv.lock.ensure_policyengine_us_compat_variablesfunction that monkey-patchedCountryTaxBenefitSystem.__init__to backfillsstb_self_employment_income,sstb_w2_wages_from_qualified_business,sstb_unadjusted_basis_qualified_property,sstb_self_employment_income_would_be_qualified,sstb_qualified_business_income,total_self_employment_income, and the SSTB-aware QBI/QBID formulas.tests/unit/test_package_imports.py— they exercised the shim's QBID arithmetic, which is now covered by policyengine-us's own test suite.test_validate_database_accepts_compat_variables→test_validate_database_accepts_total_self_employment_incomesince the variable is no longer compat.Net diff: +14 / −578 lines across 7 files (plus the lockfile).
Why
The original shim was a pragmatic bridge while policyengine-us and policyengine-us-data shipped the split on independent release cadences. Keeping it indefinitely has two costs:
CountryTaxBenefitSystem.__init__monkey-patch is a side effect that's hard to reason about for downstream consumers.The shim was self-disabling (
needs_sstb_qbi_compat = "sstb_qualified_business_income" not in tbs.variables), so removing it is purely a dead-code cleanup for any consumer on policyengine-us 1.637.0+.Test plan
ruff format --check .— cleanuv lock— resolves cleanly with 1.637.0Note: changelog fragment is named
+slim-sstb-compat.changed.mdas a placeholder; will rename to<PR_NUMBER>.changed.mdafter this PR lands its number.🤖 Generated with Claude Code