Replace legacy client with generated typed Public Reports API - #7
Merged
Conversation
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.
Replace the process-wide client and partially covered generated API with a small instance-based
Client, generated typed filters and Pydantic rows for all 242 Public Reports endpoints. Shared transport handles authentication, token refresh, retries, sync/async pagination, and typed product/archive/bundle metadata. Anonymous dashboards are typed as well.This is a breaking API redesign: callers use
Clientand typed rows instead of the legacy global configuration and DataFrame interface. Runtime dependencies are httpx, httpx-retries, and pydantic. Historical CSV readers are in a separate stacked PR; this PR's file downloads return ZIP bytes. MIS and the separate ESR API are excluded.Review the handwritten transport, generator, and tests first. Most of the diff is generated methods and captured public response metadata. Each of the 242 generated methods is exercised against its captured response through mocked HTTP; those samples prove row decoding, not complete historical coverage.
Validation of the exact staged core snapshot: 259 tests passed, strict mypy passed, Ruff passed, and git diff check passed. Earlier live requests supplied the captured schemas; no credentials are included.
Replaces the earlier worker's PR stack #1–#6 as the implementation direction. Their branches are retained for useful source discoveries and remaining historical formats.