Skip to content

feat(budget): account_category and source_anomalies on budget accounts - #76

Merged
vdavez merged 1 commit into
mainfrom
feat/budget-account-anomalies-category
Oct 2, 2026
Merged

vdavez merged 1 commit into
mainfrom
feat/budget-account-anomalies-category

Conversation

@makegov-mark

@makegov-mark makegov-mark Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What

Supports the Tango API 5.7.0 and 5.8.0 budget-account changes: account_category, source_anomalies, and data_through_period (the File A fiscal period, 1–12, an account-year's figures run through; null with no File A data) with its data_through_period / _gte / _lte / _isnull filters.

  • account_category and source_anomalies are added to BUDGET_ACCOUNTS_MINIMAL, so they appear in the default shape just as they do in the API's default shape. Both are also accepted in custom shapes through the regenerated shape overlay.
  • New BudgetAccountSourceAnomaly, BudgetAccountAnomalySource and BudgetAccountAnomalySourceRow TypedDicts type the anomaly objects. They are exported from tango, every key is optional, and BudgetAccount.source_anomalies is typed as a list of them.
  • list_budget_accounts() gains two filters: account_category, which sends account_category, and account_category_in, which sends account_category__in as a comma-separated list.
  • The ordering docstring now documents the API's default ordering, which puts accounts with no enacted_ba last.
  • The vendored contracts/filter_shape_contract.json is refreshed to 5.7.0. contracts/observed_shape_types.json records source_anomalies as a list of objects, and tango/shapes/generated_overlay.py is regenerated from both.
  • docs/API_REFERENCE.md and CHANGELOG.md (Unreleased) are updated.

account_category and an anomaly's code and action are documented as open strings.

Testing

  • uv run pytest: 586 passed, 31 skipped. This includes new unit tests for the filter params, for default-shape parsing of source_anomalies / account_category (including the [] case), and for an explicit shape on get_budget_account().
  • ruff format --check tango/, ruff check tango/ and mypy tango/ are all clean.
  • check_filter_shape_conformance.py reports 0 errors. check_shape_coverage.py reports 0 new gaps.

🤖 Generated with Claude Code

Supports the Tango API 5.7.0 budget-account contract: `account_category` and `source_anomalies` in the default `BUDGET_ACCOUNTS_MINIMAL` shape and the shape overlay, typed `BudgetAccountSourceAnomaly` / `BudgetAccountAnomalySource` / `BudgetAccountAnomalySourceRow` TypedDicts, and the `account_category` / `account_category_in` filters on `list_budget_accounts()`.
Re-vendors the API contract at 5.7.0, regenerates the shape overlay, and documents the default ordering (accounts without `enacted_ba` last).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vdavez
vdavez force-pushed the feat/budget-account-anomalies-category branch from f788533 to ed570dc Compare October 2, 2026 18:50
@vdavez
vdavez marked this pull request as ready for review October 2, 2026 18:50
@vdavez
vdavez merged commit 3c1565c into main Oct 2, 2026
11 checks passed
@makegov-mark makegov-mark Bot mentioned this pull request Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant