-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Pass CommitProperties object custom metadata in deltalake #3914
base: main
Are you sure you want to change the base?
Conversation
e9321ff
to
32e86e8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3914 +/- ##
==========================================
+ Coverage 77.54% 78.50% +0.95%
==========================================
Files 767 773 +6
Lines 99440 98465 -975
==========================================
+ Hits 77113 77300 +187
+ Misses 22327 21165 -1162
🚀 New features to boost your workflow:
|
Hi @tkauf15k, thank you for contributing this! I'll give it a review soon |
184f3a9
to
9e2a722
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @tkauf15k, thanks for the PR! The change looks good, but instead of doing a try except, why don't we make the behavior be dependent on the deltalake version? We can do this by conditioning on parse(deltalake.__version__) < parse("0.20.0")
Also, instead of creating the _create_custom_metadata
function, could you instead just call table._table.create_write_transaction
with different parameters depending on the deltalake version?
I know the try-except is a bit ugly. I considered the I added the function only to keep the "compatibility code" close to the imports. Should we go with the |
Yeah that's a good point. We actually do already assume that packaging is installed for certain deltalake operations (example). We should really just add it as a dependency for the |
9e2a722
to
b1f0435
Compare
Updated it and added few tests. @kevinzwang any idea what's happening in the integration tests? |
Since deltalake>=0.20.0, the api for providing custom metadata has changed.
Before, custom metadata could be provided as dict; now it has to be encapsulated by a
CommitProperties
object.See here.
Other commit properties not relevant atm.
There are no version constraints used for deltalake at the moment, so i kept it untouched.
Might be the time to add >=0.20.0.