-
-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, will commit again. |
||
- | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5446,3 +5446,18 @@ def test_read_with_where_tz_aware_index(self): | |
store.append(key, expected, format="table", append=True) | ||
result = pd.read_hdf(path, key, where="DATE > 20151130") | ||
assert_frame_equal(result, expected) | ||
|
||
def test_py2_created_with_datetimez(self, datapath): | ||
""" | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. This is typically written as a comment. |
||
""" | ||
index = [pd.Timestamp("2019-01-01T18:00").tz_localize("America/New_York")] | ||
expected = DataFrame({"data": 123}, index=index) | ||
with ensure_clean_store( | ||
datapath("io", "data", "legacy_hdf", "gh26443.h5"), mode="r" | ||
) as store: | ||
result = store["key"] | ||
assert_frame_equal(result, expected) |
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.