Skip to content

Commit 7e89cc3

Browse files
authored
BUG in read_pickle (#48007)
* fix: read_pickle notes on backward compatibility * updated: flake8 error handling * updated: removed trailing whitespace * updated: trim whitespace
1 parent 8420581 commit 7e89cc3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pandas/io/pickle.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,14 @@ def read_pickle(
160160
161161
Notes
162162
-----
163-
read_pickle is only guaranteed to be backwards compatible to pandas 0.20.3.
163+
read_pickle is only guaranteed to be backwards compatible to pandas 0.20.3
164+
provided the object was serialized with to_pickle.
164165
165166
Examples
166167
--------
167-
>>> original_df = pd.DataFrame({{"foo": range(5), "bar": range(5, 10)}}) # doctest: +SKIP
168+
>>> original_df = pd.DataFrame(
169+
... {{"foo": range(5), "bar": range(5, 10)}}
170+
... ) # doctest: +SKIP
168171
>>> original_df # doctest: +SKIP
169172
foo bar
170173
0 0 5
@@ -182,7 +185,7 @@ def read_pickle(
182185
2 2 7
183186
3 3 8
184187
4 4 9
185-
""" # noqa: E501
188+
"""
186189
excs_to_catch = (AttributeError, ImportError, ModuleNotFoundError, TypeError)
187190
with get_handle(
188191
filepath_or_buffer,

0 commit comments

Comments
 (0)