Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

kszucs
Copy link
Member

@kszucs kszucs commented Nov 15, 2018

No description provided.

Copy link
Member

@wesm wesm left a 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)

@wesm wesm closed this in 6e46bdc Nov 15, 2018
return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
else:

if isinstance(tz, pytz.tzinfo.BaseTzInfo):
Copy link
Member

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?

@wesm
Copy link
Member

wesm commented Dec 7, 2018

I reopened the issue in JIRA. @kszucs could you have a look?

@kszucs
Copy link
Member Author

kszucs commented Dec 7, 2018

@wesm sure

@kszucs
Copy link
Member Author

kszucs commented Dec 17, 2018

@wesm this is probably about having an is pytz.utc condition. How should I test it, just manually?

@wesm
Copy link
Member

wesm commented Dec 17, 2018

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

@kszucs
Copy link
Member Author

kszucs commented Dec 17, 2018

I'll pin it then.

@wesm
Copy link
Member

wesm commented Dec 17, 2018

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants