feat: flatten_stream returns list[Path] (v2.0.4) - #17
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.
Summary
flatten_streamnow returnslist[Path](the paths of all files written) instead ofNonewriter.close()→stream_process()→flatten_stream()Changes
base.py,csv.py,arrow_base.py,avro.py):StreamingWriter.close()abstract signature updated to-> list[Path]; each concrete writer tracks and returns written file pathsstreaming.py):stream_process()captures and returnslist[Path]fromwriter.close()api.py):flatten_stream()captures and returns result ofstream_process(); docstring updated withReturns:sectionassert result is Noneassertions to verify returned list is non-empty and all paths existapi.mdandstreaming.mdwith new return type and usage examplesTest plan
poetry run pytest tests/unit/test_api_flatten.py::TestFlattenStream -vpoetry run pytest tests/unit/test_streaming.py -vpoetry run pytest(full suite)Note
Low Risk
Low risk: behavior is additive for callers who ignored the return value, and changes are limited to return-type plumbing and path tracking in streaming writers.
Overview
flatten_stream()now returns alist[Path]of all output files written (rather thanNone), by propagating the return value fromStreamingWriter.close()throughstream_process()to the public API.To support this, streaming writers (CSV, PyArrow/Parquet/ORC, Avro) now track written file paths and return them on
close(), and docs/tests were updated accordingly; version is bumped to 2.0.4.Written by Cursor Bugbot for commit a5f8440. This will update automatically on new commits. Configure here.