IO: Extract PyArrowFileIO into dedicated module - #3738
Open
qzyu999 wants to merge 1 commit into
Open
Conversation
Move PyArrowFile, PyArrowFileIO, PyArrowLocalFileSystem and their helpers (_cached_resolve_s3_region, _import_retry_strategy) into pyiceberg/io/_pyarrow_fileio.py. The original pyiceberg/io/pyarrow.py re-exports all public names for full backward compatibility. This is the first step toward decomposing the 3100+ line pyarrow.py monolith into focused modules by concern, enabling future pluggable compute engines.
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
Extract
PyArrowFile,PyArrowFileIO,PyArrowLocalFileSystemand their helper functions into a newpyiceberg/io/_pyarrow_fileio.pymodule. The originalpyiceberg/io/pyarrow.pyre-exports all public names for full backward compatibility.This is the first step toward decomposing the 3,100+ line
pyarrow.pymonolith into focused modules by concern (tracked in #3737).Changes
pyiceberg/io/_pyarrow_fileio.py(584 lines) containing the FileIO implementationpyiceberg/io/pyarrow.py(-537 lines) replaced inline definitions with re-exportspyarrow.pythat were only needed by the FileIO sectionWhat stays the same
from pyiceberg.io.pyarrow import PyArrowFileIOimports continue to workPyArrowFileIOworks unchangedWhy
pyarrow.pyhandles 6 unrelated concerns in one file. The FileIO concern (filesystem abstraction for S3/GCS/Azure/HDFS/local) has zero coupling to schema conversion, expression translation, or statistics collection. Extracting it:Testing
Full unit test suite passes: 3803 passed, 3 skipped, 0 failures, 0 errors
(Windows local testing requires #3721 + #3722 applied on top; Linux CI should pass without them.)