-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
BUG: Bug fix implement __reduce__/__setstate__ for Period pickle support #10441
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
f9c517f
f55d3dc
81f76f2
22d9ad5
4f7b514
c8e8a10
278930e
c2d0e87
95f2db4
235570d
f64f746
a4cc715
2c25c21
047839c
608a28e
f3aa671
d1739d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ | |
|
||
""" | ||
|
||
import pickle | ||
import os | ||
|
||
from datetime import datetime, date, timedelta | ||
|
||
from numpy.ma.testutils import assert_equal | ||
|
@@ -2537,6 +2540,16 @@ def test_searchsorted(self): | |
ValueError, 'Different period frequency: H', | ||
lambda: pidx.searchsorted(pd.Period('2014-01-01', freq='H'))) | ||
|
||
def test_round_trip_pickle(self): | ||
|
||
p = Period('2000Q1') | ||
pickle_path = os.path.join(tm.get_data_path(), | ||
'period.pickle') | ||
|
||
with open(pickle_path, 'wb') as f: pickle.dump(p, f) | ||
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. use test_round_trip 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. pls use test_round_trip 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 mean result = self.round_trip_pickle(..) 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. also need to add a period in pandas/io/tests/generate_legacy_data.py 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. do you mean in pandas/io/tests/generate_legacy_pickles? On Wed, Aug 5, 2015 at 6:00 PM, Jeff Reback notifications@github.com
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. https://github.com/pydata/pandas/blob/master/pandas/io/tests/generate_legacy_storage_files.py u may need to rebase on master 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.
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. sorry a bit new with this, what is it you need me to do? Thanks. On Thu, Aug 20, 2015 at 9:17 AM, Jeff Reback notifications@github.com
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. 2 things
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, used the self.round_trip_pickle and add a period series to the On Thu, Aug 20, 2015 at 10:03 AM, Jeff Reback notifications@github.com
|
||
|
||
self.assertEqual(p, pd.read_pickle(pickle_path)) | ||
|
||
def _permute(obj): | ||
return obj.take(np.random.permutation(len(obj))) | ||
|
||
|
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.
pls use
self.round_trip_pickle
to test