-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
REGR: unpickling in 1.3.0 DataFrame created in 1.2.x #42345 #42394
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 all commits
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 |
---|---|---|
|
@@ -162,9 +162,9 @@ def compare_index_period(result, expected, typ, version): | |
tm.assert_index_equal(result.shift(2), expected.shift(2)) | ||
|
||
|
||
files = glob.glob( | ||
os.path.join(os.path.dirname(__file__), "data", "legacy_pickle", "*", "*.pickle") | ||
) | ||
here = os.path.dirname(__file__) | ||
legacy_dirname = os.path.join(here, "data", "legacy_pickle") | ||
files = glob.glob(os.path.join(legacy_dirname, "*", "*.pickle")) | ||
|
||
|
||
@pytest.fixture(params=files) | ||
|
@@ -633,3 +633,13 @@ def test_pickle_big_dataframe_compression(protocol, compression): | |
partial(pd.read_pickle, compression=compression), | ||
) | ||
tm.assert_frame_equal(df, result) | ||
|
||
|
||
def test_pickle_frame_v124_unpickle_130(): | ||
# GH#42345 DataFrame created in 1.2.x, unpickle in 1.3.x | ||
path = os.path.join(legacy_dirname, "1.2.4", "empty_frame_v1_2_4-GH#42345.pkl") | ||
with open(path, "rb") as fd: | ||
df = pickle.load(fd) | ||
|
||
expected = pd.DataFrame() | ||
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. can i add another case with columns and index (respectively) as well (but no rows) 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 test is highly focused, let's hold off on adding to this test and do a dedicated pass using the generate_legacy_storage_files pattern 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. ahh ok, yeah i think that would be a great idea. |
||
tm.assert_frame_equal(df, 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.
can you also do thsi with
pd.read_pickle
(I think it works w/o your change prob)