Repository navigation
feat(async): stream daily extract downloads through core - #192
Open
WilliamK112 wants to merge 2 commits into
Open
WilliamK112 wants to merge 2 commits into
WilliamK112 wants to merge 2 commits into
Conversation
Signed-off-by: WilliamK112 <164879897+WilliamK112@users.noreply.github.com>
This branch has not been deployed
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.
Add
ofsc.core.get_daily_extract_file_stream(date, filename, chunk_size=8192)to the async client, as requested in #161. It is an async context manager yielding decoded byte chunks from the shared HTTP client's streaming response, so callers can consume large extracts incrementally.Keep the response open during iteration and close it on completion, early exit, consumer exceptions, and cancellation. Preserve existing typed API errors by reading error responses, and translate connection/download read failures to
OFSCNetworkError; errors from the caller's own upload or processing code retain their identity. Reject nonpositive chunk sizes before making a request. Add a README usage example.Fixes #161.
Validation:
MockTransport: lazy consumption of an 80 MiB logical response with one reusable chunk, logging enabled/disabled, custom chunk boundaries, empty responses, HTTP error details, connection/read errors, cancellation, and consumer errors.get_all_activitiesdate-default diagnostics reproduced in a pristinemaster@56ded86worktree; it reports no diagnostics in the new method.Validation uses synthetic streams and no tenant credentials; a live OFS extract download has not been run.