Repository navigation
fix(client-contract): ask the file selector only for the keys it reads - #33
Merged
Merged
Conversation
A file-selector rule names format, bundle and layout; the validator, capture tool and selector scenarios derive the query from it. The validator compares values by one rule and reports malformed vectors, and the base-URL and client-identity rules close the cases where Python and WHATWG clients disagreed.
…d columns out of sort keys A resumed operation's result takes the rendering its build posted, and refs are checked against the build that served their file. List and struct columns never sort, the reference same_value is the validator's, selector queries lowercase booleans only, and the capture's OECD prerequisite keeps party totals.
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.
The client contract's file-selector fallback now asks dfo-apis only for the keys its selector reads. A default fetch records
without_party_totals: truein its ref, andselector_pathput the whole rendering intoGET /datasets/{id}/{cv}/file, which dfo-apis refuses with 400request_invalid(its selector readsformat,bundleandlayout). So a default-fetched ref whose file had expired or gone unlisted raised instead of rebuilding. The two scenarios for that path are synthetic and faked a 302 for the refused URL.A new
file-selectorrule (rules/file-selector.json,query_keys: [format, bundle, layout], four vectors) names the keys once. The validator and the capture tool both build the selector query from it, and the two synthetic scenarios now requestfile?format=parquet&bundle=false, the URL dev answers with a 302 to the stored digest. The published SDK has the same fault in both languages; its fix follows in DevelopmentFinanceObservatory/sdk once this merges.Other changes:
same_value): numbers by value, so 1 equals 1.0, booleans apart from numbers, NaN equal to NaN, lists and structs item by item. The referencereading_orderintests/test_rules.pyuses the same rule, and the vectorinteger-and-float-are-one-valuepins it.%2edot segments, backslashes and ports outside 1 to 65535, with ten vectors checked against WHATWGURL. The client-identity rule labels a non-browser runtime such as Cloudflare Workersother.party_totals, andmint-async-buildstates the option it was recorded with.entity_choicegroups offer the same labels (choose-refused-label-in-two-groups).CONTRIBUTING.mdandtools/README.mdname pyarrow, and the spec-kit changelog says the registry recordsframe_unavailableonpresentation.writeat 404 only, while dfo-apis also serves it at 503 for an artifact read failure.Testing:
uv run tools/validate_client_contract.pypasses; the tools tests (574) and the six package suites pass.