Skip to content

BUG: Bug in pickling of a non-regular freq DatetimeIndex #11002 #11006

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

Merged
merged 1 commit into from
Sep 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.17.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ Bug Fixes
- Bug in clearing the cache on ``DataFrame.pop`` and a subsequent inplace op (:issue:`10912`)
- Bug in indexing with a mixed-integer ``Index`` causing an ``ImportError`` (:issue:`10610`)
- Bug in ``Series.count`` when index has nulls (:issue:`10946`)

- Bug in pickling of a non-regular freq ``DatetimeIndex`` (:issue:`11002`)
- Bug causing ``DataFrame.where`` to not respect the ``axis`` parameter when the frame has a symmetric shape. (:issue:`9736`)

- Bug in ``Table.select_column`` where name is not preserved (:issue:`10392`)
Expand Down
3 changes: 2 additions & 1 deletion pandas/tseries/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ def _new_DatetimeIndex(cls, d):
# data are already in UTC
# so need to localize
tz = d.pop('tz',None)
result = cls.__new__(cls, **d)

result = cls.__new__(cls, verify_integrity=False, **d)
if tz is not None:
result = result.tz_localize('UTC').tz_convert(tz)
return result
Expand Down
7 changes: 6 additions & 1 deletion pandas/tseries/tests/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -2142,8 +2142,8 @@ def test_period_resample_with_local_timezone_dateutil(self):


def test_pickle(self):
#GH4606

# GH4606
p = self.round_trip_pickle(NaT)
self.assertTrue(p is NaT)

Expand All @@ -2153,6 +2153,11 @@ def test_pickle(self):
self.assertTrue(idx_p[1] is NaT)
self.assertTrue(idx_p[2] == idx[2])

# GH11002
# don't infer freq
idx = date_range('1750-1-1', '2050-1-1', freq='7D')
idx_p = self.round_trip_pickle(idx)
tm.assert_index_equal(idx, idx_p)

def _simple_ts(start, end, freq='D'):
rng = date_range(start, end, freq=freq)
Expand Down