Skip to content

document and test matched_by on agency-filter diagnostics - #84

Merged
vdavez merged 1 commit into
mainfrom
feat/resolved-filters-matched-by
Oct 6, 2026
Merged

vdavez merged 1 commit into
mainfrom
feat/resolved-filters-matched-by

Conversation

@makegov-mark

@makegov-mark makegov-mark Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

What

Tango API 5.9.0 adds matched_by to each entry of meta.resolved_filters.<filter name>[] that resolved, saying how the token matched:

  • key: an organization UUID.
  • code: a 3-digit CGAC or 4-digit FPDS code.
  • name: the organization's name, including a department's everyday name, a spelling variant or a rename.
  • alias: an abbreviation or the organization's own alias.
  • fuzzy: a looser text match, worth checking against the resolved name.

An entry that did not resolve has no matched_by.
The change is additive.

Why no behaviour change

PaginatedResponse.meta is a plain dict[str, Any] passed through as the API sends it, so matched_by already reaches callers.
This PR only documents the field and pins it with a test.

Changes

  • tango/models.py: the meta attribute docstring describes matched_by and its five values.
  • README.md: a short example that flags fuzzy matches.
  • tests/test_client.py: one test that a response carrying matched_by round-trips through response.meta, and that unresolved_agency_tokens and resolved_agencies are unchanged by it.
  • CHANGELOG.md: entry under [Unreleased].

Testing

  • uv run ruff format --check tango/
  • uv run ruff check tango/
  • uv run mypy tango/
  • uv run pytest (599 passed, 31 skipped)

Not in this PR

  • No version bump; that belongs to the release PR.
  • No new accessor. resolved_agencies returns only the matched organizations, so matched_by is read from response.meta directly. An accessor that exposes it (for example one listing loosely matched tokens per filter) would be new public surface and is left as a follow-up decision.

🤖 Generated with Claude Code

…ostics

Tango API 5.9.0 adds `matched_by` to each resolved entry of `meta.resolved_filters`, saying how the token matched: `key`, `code`, `name`, `alias` or `fuzzy`.
`PaginatedResponse.meta` is passed through as the API sends it, so the field already reaches callers.
This documents it on the `meta` attribute and in the README, and adds a test that it round-trips and leaves the three agency accessors unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@makegov-mark makegov-mark Bot changed the title WIP: document and test matched_by on agency-filter diagnostics document and test matched_by on agency-filter diagnostics Oct 6, 2026
@vdavez
vdavez marked this pull request as ready for review October 6, 2026 19:58
@vdavez
vdavez merged commit e47ab1b into main Oct 6, 2026
11 checks passed
@makegov-mark makegov-mark Bot mentioned this pull request Oct 6, 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