v0.6.0#21
Open
makegov-mark[bot] wants to merge 2 commits intomainfrom
Open
Conversation
Bring the vehicles client up to date with the upstream tango "lakehouse
cutover" (May 2026). Adds new top-level fields, a `metrics(*)` shape
expansion, the `/api/vehicles/{uuid}/orders/` endpoint, an `ordering`
query param, and DeprecationWarning emission for fields the API now
sends a `Deprecation: true` header for.
Cassettes re-recorded against current production. Defaults verified to
match production's shape contract (organization is a leaf dict, /orders/
rejects `uuid`, organization payload includes `organization_id`).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace references to the upstream "lakehouse" with neutral language
("computed metrics", "upstream sync") in CHANGELOG, API_REFERENCE,
SHAPES, source comments, and test docstrings. Internal storage details
(e.g. "denormalized lakehouse table") replaced with capability framing
("optimized for fast pagination").
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Brings the vehicles client up to date with the upstream tango vehicles surface. Cassettes re-recorded against current production; SDK defaults verified to match production's shape contract.
Added
program_acronym,idv_count,total_obligated,is_synthetic_solicitation,latest_award_date,description,opportunity_id, and a liveorganizationsnapshot dict ({organization_id, office_code, office_name, agency_code, agency_name, department_code, department_name}).metrics(*)shape expansion bundling 12 computed metrics (HHI, competed_rate, avg/max order value, top recipient share, recent 24mo windows, etc.). Backed by a newVehicleMetricsschema.list_vehicle_orders(uuid, ...)for/api/vehicles/{uuid}/orders/.orderingparameter onlist_vehicles(whitelist:vehicle_obligations,latest_award_date) andlist_vehicle_orders(whitelist:award_date,obligated,total_contract_value).ShapeConfig.VEHICLE_ORDERS_MINIMAL.VehicleandVehicleMetricsexported from the top-leveltangopackage.Changed
ShapeConfig.VEHICLES_MINIMALandVEHICLES_COMPREHENSIVEupdated to include the new top-level fields and the liveorganizationleaf.VEHICLES_COMPREHENSIVEdefaults tometrics(*)and no longer includes the deprecatedcompetition_details(*)blob.Deprecated
agency_details,competition_details, and theopportunityexpansion — the API now sendsDeprecation: truefor these. Explicit use inshape=...emits a PythonDeprecationWarning. Sunset timeline TBD upstream.Why
The upstream tango vehicles endpoint surface added 12 new computed metrics, exposed
program_acronym/idv_count/total_obligated/is_synthetic_solicitationas first-class fields, and consolidated the awarding-org snapshot under a singleorganizationpayload. The SDK was at the prior surface and would have left callers walking dicts manually for any of the new fields.Production-vs-source-tree gaps that informed this PR
While probing the live API, three gaps between the local
../tango/HEAD code and what production currently serves shaped the implementation:organizationis a leaf, not a sub-selectable expansion — production rejectsshape=...,organization(office_code,...)asInvalid shape. Bareshape=...,organizationreturns the full dict. SDK treats it as a leaf dict (nonested_model).organizationpayload includesorganization_idalongside the office-hierarchy fields — 7 keys total./api/vehicles/{uuid}/orders/rejectsuuidin shape — acceptskey, piid, award_date, obligated, total_contract_value, description, recipient(...)etc. SDK default shape (VEHICLE_ORDERS_MINIMAL) omitsuuid.If/when production catches up to the source-tree expansion syntax, the SDK's leaf handling will keep working with no client-side change required.
Test plan
uv run ruff format .— 4 files reformatted (consumed in this PR)uv run ruff check tango/ tests/integration/test_vehicles_idvs_integration.py tests/production/test_production_smoke.py— cleanuv run mypy tango/— adds 0 new errors (24 pre-existing intango/shapes/{schema,parser,generator,factory}.py, verified via stash diff)uv run pytest -m "not integration and not production"— 215 passeduv run pytest tests/integration/test_vehicles_idvs_integration.py::TestVehiclesIntegration— 7/7 pass on cassettesTANGO_REFRESH_CASSETTES=true) and replay cleanly without a live keyclient.list_vehicles(ordering="-vehicle_obligations"),client.get_vehicle(uuid, shape="uuid,metrics(*)"),client.list_vehicle_orders(uuid, ordering="-obligated"), deprecation warning onagency_detailsCompanion docs
Companion PR against
makegov/docs: makegov/docs#3 — refreshes the public data-dictionary page for the new field set,metrics(*)expansion,/orderssub-endpoint, and theorganizationleaf-vs-expansion behavior.Risks / next steps
agency_details/competition_details/opportunity. When tango publishes aSunset:header, a follow-up SDK release should remove the schema entries.descriptions(andusing_agenciesinside metrics) may come back asnulluntil upstream sync handles array literals; the SDK exposes the schema fields either way.${MAKEGOV_BOT_SIGNATURE}