Repository navigation
document and test matched_by on agency-filter diagnostics - #84
Merged
Merged
Conversation
…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>
vdavez
marked this pull request as ready for review
October 6, 2026 19:58
Merged
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.
What
Tango API 5.9.0 adds
matched_byto each entry ofmeta.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.metais a plaindict[str, Any]passed through as the API sends it, somatched_byalready reaches callers.This PR only documents the field and pins it with a test.
Changes
tango/models.py: themetaattribute docstring describesmatched_byand its five values.README.md: a short example that flagsfuzzymatches.tests/test_client.py: one test that a response carryingmatched_byround-trips throughresponse.meta, and thatunresolved_agency_tokensandresolved_agenciesare 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
resolved_agenciesreturns only the matched organizations, somatched_byis read fromresponse.metadirectly. 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