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
ARROW-3703: [Python] DataFrame.to_parquet crashes if datetime column has time zones #2975
Conversation
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.
+1, thanks! I wasn't aware of datetime.timezone
(I guess because it's Python 3 only)
return '{}{:02d}:{:02d}'.format(sign, hours, minutes) | ||
else: | ||
|
||
if isinstance(tz, pytz.tzinfo.BaseTzInfo): |
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.
Apparently, pytz.UTC
is only a subclass of BaseTzInfo starting from pytz 2018.4 (https://launchpad.net/pytz/+announcement/14962), so with older versions of pytz there are now failures in the tests due to:
In [4]: pyarrow.lib.tzinfo_to_string(pytz.utc)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-4-8559e74fba95> in <module>()
----> 1 pyarrow.lib.tzinfo_to_string(pytz.utc)
~/scipy/repos/arrow/python/pyarrow/types.pxi in pyarrow.lib.tzinfo_to_string()
ValueError: Unable to convert timezone `UTC` to string
Is there a minimum version of pytz that is officially supported?
I reopened the issue in JIRA. @kszucs could you have a look? |
@wesm sure |
@wesm this is probably about having an |
Yeah, I think to install an older version of pytz. I don't think we need to do anything crazy to run this in CI or Docker |
I'll pin it then. |
I think we can keep testing with the latest pytz release, but if we can at least fix the failure on old versions for now that will be a useful stopgap (the fix might bitrot; if it ends up being an issue we can always test more systematically) |
No description provided.