-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Python: Add support date
, time
and datetime
in to_bytes
#8214
Python: Add support date
, time
and datetime
in to_bytes
#8214
Conversation
This is great @onerishabh, can you throw in some tests in |
@Fokko tests added as well |
@onerishabh Sorry, I was not specific about the testing. I think we're super close, but I would love to see tests like: to_bytes(DateType(), date(1925, 1, 1)) == b"..." For the |
@Fokko , have a look now. Added a new function to do this testing! |
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.
@onerishabh Thanks, exactly the tests that I was looking for, thank you for working on this 🙏🏻
Wohoooo 🎉 |
date
,time
anddatetime
types to bytes.pyiceberg/utils/datetime.py
functions to convert date/timestamp to epoch microseconds.Test Cases (epoch microseconds used for testing):
datetime(2023, 3, 1, 19, 25, 0)
datetime(2023, 3, 1, 19, 25, 0, tzinfo=timezone.utc)
date(2023, 3, 1)
time(12, 30, 45, 500000)
Issue: #8191