8000 BUG: Bug fix implement __reduce__/__setstate__ for Period pickle support by scarrucciu · Pull Request #10441 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

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

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
10441 Use self.round_trip_pickle to test in test_period
  • Loading branch information
Spencer Carrucciu committed Aug 20, 2015
commit f64f7467cab6464a9ac30581ecb7ef0571602e52
5 changes: 0 additions & 5 deletions pandas/io/tests/generate_legacy_storage_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ def _create_sp_frame():
return SparseDataFrame(data, index=dates)


def _create_period():

return Period('2000Q1')


def create_data():
""" create the pickle/msgpack data """

Expand Down
8 changes: 3 additions & 5 deletions pandas/tseries/tests/test_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -2541,13 +2541,11 @@ def test_searchsorted(self):

def test_round_trip(self):

import pickle
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)

self.assertEqual(p, pd.read_pickle(pickle_path))
new_p = self.round_trip_pickle(p)
self.assertEqual(new_p, p)

def _permute(obj):
return obj.take(np.random.permutation(len(obj)))
Expand Down
0