-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix read of py27 pytables tz attribute, gh#26443 #28221
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
Conversation
When created by python 2.7, the "tz" attribute will be created with CSET H5T_CSET_ASCII instead of H5T_CSET_UTF8, therefore it is read as bytes when string is expected.
When created by python 2.7, the "tz" attribute will be created with CSET H5T_CSET_ASCII instead of H5T_CSET_UTF8, therefore it is read as bytes when string is expected.
Conflicts: doc/source/whatsnew/v1.0.0.rst pandas/tests/io/pytables/test_pytables.py
Thanks for the PR but not sure about this as it makes it murky as to what aspects of Py27 we still support. Without this its very clear to say nothing, so I'm maybe -1 on this as I don't think we want to start down the path of offering any Py27 legacy support going forward. Let's see what others think |
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.
This is a bit of a gray area, but since it's a low-maintenance change I think it's OK to merge.
The test HDF5 file was created in Python2, but could not be read in | ||
Python3. | ||
|
||
GH26443 |
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.
This is typically written as a comment.
doc/source/whatsnew/v1.0.0.rst
Outdated
@@ -97,6 +97,7 @@ Datetimelike | |||
^^^^^^^^^^^^ | |||
- Bug in :meth:`Series.__setitem__` incorrectly casting ``np.timedelta64("NaT")`` to ``np.datetime64("NaT")`` when inserting into a :class:`Series` with datetime64 dtype (:issue:`27311`) | |||
- Bug in :meth:`Series.dt` property lookups when the underlying data is read-only (:issue:`27529`) | |||
- Bug in :meth:`HDFStore.__getitem__` incorrectly reading tz attribute created in Py2 (:issue:`26443`) |
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.
Py2 -> Python 2.
doc/source/whatsnew/v1.0.0.rst
Outdated
@@ -97,6 +97,7 @@ Datetimelike | |||
^^^^^^^^^^^^ | |||
- Bug in :meth:`Series.__setitem__` incorrectly casting ``np.timedelta64("NaT")`` to ``np.datetime64("NaT")`` when inserting into a :class:`Series` with datetime64 dtype (:issue:`27311`) | |||
- Bug in :meth:`Series.dt` property lookups when the underlying data is read-only (:issue:`27529`) | |||
- Bug in :meth:`HDFStore.__getitem__` incorrectly reading tz attribute created in Py2 (:issue:`26443`) |
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.
I don't think magic methods are in the docs.
It also seems like we don't have a generic HDFStore
reference, so just write this as double backticks rather than :meth:.
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.
Ok, will commit again.
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.
Fine with this as well - @TomAugspurger for 1.0.0 or 0.25.2?
1.0 (I don't think it was a 0.25.x regression). |
When created by python 2.7, the "tz" attribute will be created with CSET
H5T_CSET_ASCII instead of H5T_CSET_UTF8, therefore it is read as bytes
when string is expected.
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff