feat: add support for pyiceberg 0.10.0#5277
Merged
desmondcheongzx merged 3 commits intoEventual-Inc:mainfrom Sep 25, 2025
Merged
feat: add support for pyiceberg 0.10.0#5277desmondcheongzx merged 3 commits intoEventual-Inc:mainfrom
desmondcheongzx merged 3 commits intoEventual-Inc:mainfrom
Conversation
gweaverbiodev
commented
Sep 24, 2025
Contributor
There was a problem hiding this comment.
Greptile Overview
Summary
This PR adds compatibility support for PyIceberg 0.10.0 by implementing version-specific handling for breaking API changes in DataFile and Record constructors. The changes use runtime version checking to conditionally call the appropriate constructor methods.
Key Changes
- Added version checks using
packaging.version.parse()to handle PyIceberg 0.10.0+ compatibility DataFilenow uses.from_args()method for v0.10.0+ vs direct constructor for older versionsIcebergRecordconstructor changed from keyword arguments to positional arguments for v0.10.0+- Updated test partition field names for better clarity and uniqueness
- Maintained backward compatibility with existing PyIceberg versions
Issues Found
- Minor typo in test partition field name:
"decimadecimal_truncate_partitionedl" - Import statements should be moved to module level per project conventions
Confidence Score: 4/5
- This PR is safe to merge with minor fixes needed
- The code correctly implements version-based compatibility handling with proper fallbacks. The logic is sound and maintains backward compatibility. Only minor issues are a typo and style preference for import placement.
- Pay attention to the typo in tests/io/iceberg/test_iceberg_writes.py line 412
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| daft/io/iceberg/iceberg_write.py | 4/5 | adds version-based compatibility handling for pyiceberg 0.10.0 DataFile and Record constructors with minor inline import style issue |
| tests/io/iceberg/test_iceberg_writes.py | 3/5 | updates partition field names for clarity and test compatibility with minor typo in partition field name |
Sequence Diagram
sequenceDiagram
participant Client as Daft Client
participant Writer as Iceberg Writer
participant PyIceberg as PyIceberg Library
participant Version as Version Check
Client->>Writer: write_iceberg_table()
Writer->>Version: parse(pyiceberg.__version__) >= parse("0.10.0")
alt pyiceberg >= 0.10.0
Writer->>PyIceberg: DataFile.from_args(**kwargs)
Note over Writer,PyIceberg: Uses new constructor method
Writer->>PyIceberg: IcebergRecord(*values_list)
Note over Writer,PyIceberg: Positional arguments only
else pyiceberg < 0.10.0
Writer->>PyIceberg: DataFile(**kwargs)
Note over Writer,PyIceberg: Uses legacy constructor
Writer->>PyIceberg: IcebergRecord(**values_dict)
Note over Writer,PyIceberg: Keyword arguments
end
PyIceberg-->>Writer: DataFile/Record instances
Writer-->>Client: Write successful
2 files reviewed, 2 comments
desmondcheongzx
approved these changes
Sep 24, 2025
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5277 +/- ##
==========================================
- Coverage 74.69% 74.14% -0.56%
==========================================
Files 972 972
Lines 123685 125951 +2266
==========================================
+ Hits 92392 93387 +995
- Misses 31293 32564 +1271
🚀 New features to boost your workflow:
|
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.
Changes Made
Added changes to conditionally handle breaking changes in pyiceberg 0.10.0 for how to initialize
DataFileandRecordand constraints onnameforSchemafields andPartitionField.I did not update dev dependencies at this point, because there are actually still issues with Decimal. I have a PR open that hopefully addresses this. To test, I had to temporarily change dev dependencies to 0.10.0, and run tests without decimal type. I need to update to 0.10.0 because support for anonymous was added (needed on my side). Note sure what the best path is here considering that pyiceberg releases on a much slower cadence.
Related Issues
Closes #5223
Checklist
docs/mkdocs.ymlnavigation