refactor(ledger): move report bundle download to GraphQL reportDownloadUrl#131
Merged
Merged
Conversation
…adUrl
Mirror the backend change (robosystems #751/#762): the report
serialization-bundle download moved from the retired
`GET .../reports/{id}/download` REST resource to the GraphQL read
surface (`reportDownloadUrl`). Every flavor now resolves to a presigned
S3 URL — JSON-LD is stamped at publish time, XBRL is materialized +
cached on first request — so XBRL no longer streams a zip through the
download endpoint.
- add GET_REPORT_DOWNLOAD_URL_QUERY + parse_report_download_url
- reimplement LedgerClient.download_report_bundle to resolve the URL via
GraphQL then follow it (both flavors); same signature + return shape,
so callers (incl. the demos) are unaffected. `format` still accepts
the "jsonld"/"xbrl-2.1" wire values (mapped to the enum names).
- regenerate the OpenAPI SDK (drops the dead download GET op + its
model; also picks up incidental upstream description updates)
- rewrite the download tests for the GraphQL + presigned-URL flow
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
Mirrors the backend change (robosystems #762, closes robosystems#751): the report serialization-bundle download moved from the retired
GET …/reports/{id}/downloadREST resource to the GraphQL read surface (reportDownloadUrl). Every flavor now resolves to a presigned S3 URL — JSON-LD is stamped at publish time, XBRL is materialized + cached on first request — so XBRL no longer streams a zip through the download endpoint.Changes
graphql/queries/ledger/__init__.py):GET_REPORT_DOWNLOAD_URL_QUERY+parse_report_download_url.LedgerClient.download_report_bundle(clients/ledger_client.py): reimplemented to resolve the presigned URL via GraphQLreportDownloadUrl, then follow it for the bytes — for both flavors. Signature andReportBundleDownloadreturn shape are unchanged, so existing callers (including the example demos) need no code change.formatstill accepts the"jsonld"/"xbrl-2.1"wire values (mapped to theJSONLD/XBRL_2_1enum names sent as the GraphQL variable).get_report_bundle_download_urlGET op and its response model. Also picks up incidental upstream description updates (create-taxonomy-block, create-information-block, schedule/entry request models) that the published0.3.36predated — not from this change.tests/test_ledger_client.py): rewrote the bundle-download suite for the GraphQL + presigned-URL flow (both flavors follow the URL; report-not-found and presigned-URL-failure paths).Breaking change
None to the SDK's public surface —
download_report_bundle(graph_id, report_id, format=…, to=…, expires_in=…)keeps its signature and return type. The behavior change is internal (GraphQL instead of the REST endpoint; XBRL is now a presigned URL rather than a direct stream).Testing
uv run pytest: 437 passed, 17 skipped (full suite).Notes / Follow-ups
robosystems-client==0.3.36to the new version (+uv lock) and re-run the example demos to confirm end-to-end — the demo code itself is unchanged.