diff --git a/doc/source/user_guide/io.rst b/doc/source/user_guide/io.rst index 7caaec62c0a8a..6b3edd92ab5a9 100644 --- a/doc/source/user_guide/io.rst +++ b/doc/source/user_guide/io.rst @@ -3319,16 +3319,7 @@ any pickled pandas object (or any other pickled object) from file: .. warning:: - Several internal refactoring have been done while still preserving - compatibility with pickles created with older versions of pandas. However, - for such cases, pickled ``DataFrames``, ``Series`` etc, must be read with - ``pd.read_pickle``, rather than ``pickle.load``. - - See `here `__ - and `here `__ - for some examples of compatibility-breaking changes. See - `this question `__ - for a detailed explanation. + :func:`read_pickle` is only guaranteed backwards compatible back to pandas version 0.20.3 .. _io.pickle.compression: @@ -3406,6 +3397,10 @@ both on the writing (serialization), and reading (deserialization). optimizations in the io of the ``msgpack`` data. Since this is marked as an EXPERIMENTAL LIBRARY, the storage format may not be stable until a future release. +.. warning:: + + :func:`read_msgpack` is only guaranteed backwards compatible back to pandas version 0.20.3 + .. ipython:: python df = pd.DataFrame(np.random.rand(5, 2), columns=list('AB')) diff --git a/doc/source/whatsnew/v0.25.0.rst b/doc/source/whatsnew/v0.25.0.rst index 0853a5962272a..d47b97d8a331d 100644 --- a/doc/source/whatsnew/v0.25.0.rst +++ b/doc/source/whatsnew/v0.25.0.rst @@ -13,6 +13,11 @@ What's New in 0.25.0 (April XX, 2019) `Panel` has been fully removed. For N-D labeled data structures, please use `xarray `_ +.. warning:: + + :func:`read_pickle` and :func:`read_msgpack` are only guaranteed backwards compatible back to + pandas version 0.20.3 (:issue:`27082`) + {{ header }} These are the changes in pandas 0.25.0. See :ref:`release` for a full changelog diff --git a/pandas/io/packers.py b/pandas/io/packers.py index e3d45548e4978..4a273bfe2decb 100644 --- a/pandas/io/packers.py +++ b/pandas/io/packers.py @@ -134,6 +134,11 @@ def read_msgpack(path_or_buf, encoding='utf-8', iterator=False, **kwargs): Returns ------- obj : same type as object stored in file + + Notes + ----- + read_msgpack is only guaranteed to be backwards compatible to pandas + 0.20.3. """ path_or_buf, _, _, should_close = get_filepath_or_buffer(path_or_buf) if iterator: diff --git a/pandas/io/pickle.py b/pandas/io/pickle.py index ce2ed247c158b..afe1622d99eac 100644 --- a/pandas/io/pickle.py +++ b/pandas/io/pickle.py @@ -116,6 +116,10 @@ def read_pickle(path, compression='infer'): read_sql : Read SQL query or database table into a DataFrame. read_parquet : Load a parquet object, returning a DataFrame. + Notes + ----- + read_pickle is only guaranteed to be backwards compatible to pandas 0.20.3. + Examples -------- >>> original_df = pd.DataFrame({"foo": range(5), "bar": range(5, 10)}) diff --git a/pandas/tests/io/data/legacy_msgpack/0.16.0/0.16.0_x86_64_darwin_2.7.9.msgpack b/pandas/tests/io/data/legacy_msgpack/0.16.0/0.16.0_x86_64_darwin_2.7.9.msgpack deleted file mode 100644 index 554f8a6e0742a..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.16.0/0.16.0_x86_64_darwin_2.7.9.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_AMD64_windows_2.7.10.msgpack b/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_AMD64_windows_2.7.10.msgpack deleted file mode 100644 index 7f05cc605333d..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_AMD64_windows_2.7.10.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_AMD64_windows_3.4.3.msgpack b/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_AMD64_windows_3.4.3.msgpack deleted file mode 100644 index b10d175c1d68f..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_AMD64_windows_3.4.3.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_darwin_2.7.10.msgpack b/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_darwin_2.7.10.msgpack deleted file mode 100644 index ed606295b0830..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_darwin_2.7.10.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_darwin_2.7.9.msgpack b/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_darwin_2.7.9.msgpack deleted file mode 100644 index 000879f4cb2c2..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_darwin_2.7.9.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_darwin_3.4.3.msgpack b/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_darwin_3.4.3.msgpack deleted file mode 100644 index 7a933b3a96dbb..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_darwin_3.4.3.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_linux_2.7.10.msgpack b/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_linux_2.7.10.msgpack deleted file mode 100644 index 6bf1b9b9afaaa..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_linux_2.7.10.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_linux_3.4.3.msgpack b/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_linux_3.4.3.msgpack deleted file mode 100644 index 6607570797846..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.16.2/0.16.2_x86_64_linux_3.4.3.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_AMD64_windows_2.7.11.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_AMD64_windows_2.7.11.msgpack deleted file mode 100644 index 590e11b14d88b..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_AMD64_windows_2.7.11.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_AMD64_windows_3.4.4.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_AMD64_windows_3.4.4.msgpack deleted file mode 100644 index 009c52b3f5650..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_AMD64_windows_3.4.4.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_darwin_2.7.11.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_darwin_2.7.11.msgpack deleted file mode 100644 index 16706a2229384..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_darwin_2.7.11.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_darwin_3.4.4.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_darwin_3.4.4.msgpack deleted file mode 100644 index b9834a1c2a772..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_darwin_3.4.4.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_linux_2.7.11.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_linux_2.7.11.msgpack deleted file mode 100644 index 16706a2229384..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_linux_2.7.11.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_linux_3.4.4.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_linux_3.4.4.msgpack deleted file mode 100644 index 8d4f50799832f..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.0_x86_64_linux_3.4.4.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.1_AMD64_windows_2.7.11.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.1_AMD64_windows_2.7.11.msgpack deleted file mode 100644 index 590e11b14d88b..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.1_AMD64_windows_2.7.11.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.1_AMD64_windows_3.5.1.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.1_AMD64_windows_3.5.1.msgpack deleted file mode 100644 index 20682c9749dfb..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.0/0.17.1_AMD64_windows_3.5.1.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_AMD64_windows_2.7.11.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_AMD64_windows_2.7.11.msgpack deleted file mode 100644 index 590e11b14d88b..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_AMD64_windows_2.7.11.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_AMD64_windows_3.5.1.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_AMD64_windows_3.5.1.msgpack deleted file mode 100644 index 20682c9749dfb..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_AMD64_windows_3.5.1.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_darwin_2.7.11.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_darwin_2.7.11.msgpack deleted file mode 100644 index 8cbb143434f61..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_darwin_2.7.11.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_darwin_3.5.1.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_darwin_3.5.1.msgpack deleted file mode 100644 index c6fcd3c910881..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_darwin_3.5.1.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_linux_2.7.11.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_linux_2.7.11.msgpack deleted file mode 100644 index e89b5dd99150e..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_linux_2.7.11.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_linux_3.4.4.msgpack b/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_linux_3.4.4.msgpack deleted file mode 100644 index 98efdabedea72..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.17.1/0.17.1_x86_64_linux_3.4.4.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_AMD64_windows_2.7.11.msgpack b/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_AMD64_windows_2.7.11.msgpack deleted file mode 100644 index 9185ea93acbf2..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_AMD64_windows_2.7.11.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_AMD64_windows_3.5.1.msgpack b/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_AMD64_windows_3.5.1.msgpack deleted file mode 100644 index 792ef27268aaf..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_AMD64_windows_3.5.1.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_x86_64_darwin_2.7.11.msgpack b/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_x86_64_darwin_2.7.11.msgpack deleted file mode 100644 index e3a57986656ab..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_x86_64_darwin_2.7.11.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_x86_64_darwin_3.5.1.msgpack b/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_x86_64_darwin_3.5.1.msgpack deleted file mode 100644 index 33b71200258b2..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.18.0/0.18.0_x86_64_darwin_3.5.1.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.18.1/0.18.1_x86_64_darwin_2.7.12.msgpack b/pandas/tests/io/data/legacy_msgpack/0.18.1/0.18.1_x86_64_darwin_2.7.12.msgpack deleted file mode 100644 index 978c2c5045314..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.18.1/0.18.1_x86_64_darwin_2.7.12.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.18.1/0.18.1_x86_64_darwin_3.5.2.msgpack b/pandas/tests/io/data/legacy_msgpack/0.18.1/0.18.1_x86_64_darwin_3.5.2.msgpack deleted file mode 100644 index ea8efdc86dd2d..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.18.1/0.18.1_x86_64_darwin_3.5.2.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.19.2/0.19.2_x86_64_darwin_2.7.12.msgpack b/pandas/tests/io/data/legacy_msgpack/0.19.2/0.19.2_x86_64_darwin_2.7.12.msgpack deleted file mode 100644 index f2dc38766025e..0000000000000 Binary files a/pandas/tests/io/data/legacy_msgpack/0.19.2/0.19.2_x86_64_darwin_2.7.12.msgpack and /dev/null differ diff --git a/pandas/tests/io/data/legacy_msgpack/0.19.2/0.19.2_x86_64_darwin_3.6.1.msgpack b/pandas/tests/io/data/legacy_msgpack/0.20.3/0.20.3_x86_64_darwin_3.5.2.msgpack similarity index 92% rename from pandas/tests/io/data/legacy_msgpack/0.19.2/0.19.2_x86_64_darwin_3.6.1.msgpack rename to pandas/tests/io/data/legacy_msgpack/0.20.3/0.20.3_x86_64_darwin_3.5.2.msgpack index 4137629f53cf2..7a546a82ae766 100644 Binary files a/pandas/tests/io/data/legacy_msgpack/0.19.2/0.19.2_x86_64_darwin_3.6.1.msgpack and b/pandas/tests/io/data/legacy_msgpack/0.20.3/0.20.3_x86_64_darwin_3.5.2.msgpack differ diff --git a/pandas/tests/io/data/legacy_pickle/0.10.1/AMD64_windows_2.7.3.pickle b/pandas/tests/io/data/legacy_pickle/0.10.1/AMD64_windows_2.7.3.pickle deleted file mode 100644 index 84fbd0d989569..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.10.1/AMD64_windows_2.7.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.10.1/x86_64_linux_2.7.3.pickle b/pandas/tests/io/data/legacy_pickle/0.10.1/x86_64_linux_2.7.3.pickle deleted file mode 100644 index f0787f30c1453..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.10.1/x86_64_linux_2.7.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.11.0/0.11.0_x86_64_linux_3.3.0.pickle b/pandas/tests/io/data/legacy_pickle/0.11.0/0.11.0_x86_64_linux_3.3.0.pickle deleted file mode 100644 index e057576b6894b..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.11.0/0.11.0_x86_64_linux_3.3.0.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.11.0/x86_64_linux_2.7.3.pickle b/pandas/tests/io/data/legacy_pickle/0.11.0/x86_64_linux_2.7.3.pickle deleted file mode 100644 index f0787f30c1453..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.11.0/x86_64_linux_2.7.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.11.0/x86_64_linux_3.3.0.pickle b/pandas/tests/io/data/legacy_pickle/0.11.0/x86_64_linux_3.3.0.pickle deleted file mode 100644 index e6ed07d75da64..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.11.0/x86_64_linux_3.3.0.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.12.0/0.12.0_AMD64_windows_2.7.3.pickle b/pandas/tests/io/data/legacy_pickle/0.12.0/0.12.0_AMD64_windows_2.7.3.pickle deleted file mode 100644 index 1001c0f470122..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.12.0/0.12.0_AMD64_windows_2.7.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.12.0/0.12.0_x86_64_linux_2.7.3.pickle b/pandas/tests/io/data/legacy_pickle/0.12.0/0.12.0_x86_64_linux_2.7.3.pickle deleted file mode 100644 index 3049e94791581..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.12.0/0.12.0_x86_64_linux_2.7.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_AMD64_windows_2.7.3.pickle b/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_AMD64_windows_2.7.3.pickle deleted file mode 100644 index f03ec67f4d7c4..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_AMD64_windows_2.7.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.6.5.pickle b/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.6.5.pickle deleted file mode 100644 index aa2f607fa4302..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.6.5.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.7.3.pickle b/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.7.3.pickle deleted file mode 100644 index 5c988a1b0c7ef..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_2.7.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_3.2.3.pickle b/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_3.2.3.pickle deleted file mode 100644 index 275cc4b951134..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_i686_linux_3.2.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.5.pickle b/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.5.pickle deleted file mode 100644 index 0ff7f6c68f34e..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.5.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.6.pickle b/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.6.pickle deleted file mode 100644 index 4f5bdada3c7da..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_darwin_2.7.6.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.3.pickle b/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.3.pickle deleted file mode 100644 index 0ff7f6c68f34e..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.8.pickle b/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.8.pickle deleted file mode 100644 index 3ffecb77ef8c9..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_2.7.8.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_3.3.0.pickle b/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_3.3.0.pickle deleted file mode 100644 index 5f27dd2ff056d..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.13.0/0.13.0_x86_64_linux_3.3.0.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.14.0/0.14.0_x86_64_darwin_2.7.6.pickle b/pandas/tests/io/data/legacy_pickle/0.14.0/0.14.0_x86_64_darwin_2.7.6.pickle deleted file mode 100644 index 1b1652fc03c27..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.14.0/0.14.0_x86_64_darwin_2.7.6.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.14.0/0.14.0_x86_64_linux_2.7.8.pickle b/pandas/tests/io/data/legacy_pickle/0.14.0/0.14.0_x86_64_linux_2.7.8.pickle deleted file mode 100644 index 19cbcddc4ded8..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.14.0/0.14.0_x86_64_linux_2.7.8.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.14.1/0.14.1_x86_64_darwin_2.7.12.pickle b/pandas/tests/io/data/legacy_pickle/0.14.1/0.14.1_x86_64_darwin_2.7.12.pickle deleted file mode 100644 index 917ad2b0ff1a3..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.14.1/0.14.1_x86_64_darwin_2.7.12.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.14.1/0.14.1_x86_64_linux_2.7.8.pickle b/pandas/tests/io/data/legacy_pickle/0.14.1/0.14.1_x86_64_linux_2.7.8.pickle deleted file mode 100644 index af530fcd3fb39..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.14.1/0.14.1_x86_64_linux_2.7.8.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.15.0/0.15.0_x86_64_darwin_2.7.12.pickle b/pandas/tests/io/data/legacy_pickle/0.15.0/0.15.0_x86_64_darwin_2.7.12.pickle deleted file mode 100644 index c7a745cf9b458..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.15.0/0.15.0_x86_64_darwin_2.7.12.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.15.0/0.15.0_x86_64_linux_2.7.8.pickle b/pandas/tests/io/data/legacy_pickle/0.15.0/0.15.0_x86_64_linux_2.7.8.pickle deleted file mode 100644 index d7d20b06df305..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.15.0/0.15.0_x86_64_linux_2.7.8.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.15.2/0.15.2_x86_64_darwin_2.7.9.pickle b/pandas/tests/io/data/legacy_pickle/0.15.2/0.15.2_x86_64_darwin_2.7.9.pickle deleted file mode 100644 index 1a01539700cf1..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.15.2/0.15.2_x86_64_darwin_2.7.9.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.16.0/0.16.0_x86_64_darwin_2.7.9.pickle b/pandas/tests/io/data/legacy_pickle/0.16.0/0.16.0_x86_64_darwin_2.7.9.pickle deleted file mode 100644 index d45936baa1e00..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.16.0/0.16.0_x86_64_darwin_2.7.9.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_2.7.10.pickle b/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_2.7.10.pickle deleted file mode 100644 index 3191b4843148a..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_2.7.10.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_2.7.14.pickle b/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_2.7.14.pickle deleted file mode 100644 index 6341fa26d1f25..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_2.7.14.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_3.4.3.pickle b/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_3.4.3.pickle deleted file mode 100644 index 7742c117f265c..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_AMD64_windows_3.4.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_2.7.10.pickle b/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_2.7.10.pickle deleted file mode 100644 index d279403b3c765..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_2.7.10.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_2.7.9.pickle b/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_2.7.9.pickle deleted file mode 100644 index d45936baa1e00..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_2.7.9.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_3.4.3.pickle b/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_3.4.3.pickle deleted file mode 100644 index e480d5ac21729..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_darwin_3.4.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_linux_2.7.10.pickle b/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_linux_2.7.10.pickle deleted file mode 100644 index 60101c2f1e95e..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_linux_2.7.10.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_linux_3.4.3.pickle b/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_linux_3.4.3.pickle deleted file mode 100644 index 6d5451f96e20d..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.16.2/0.16.2_x86_64_linux_3.4.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_AMD64_windows_2.7.11.pickle b/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_AMD64_windows_2.7.11.pickle deleted file mode 100644 index 2b91b9ab5552b..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_AMD64_windows_2.7.11.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_AMD64_windows_3.4.4.pickle b/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_AMD64_windows_3.4.4.pickle deleted file mode 100644 index 1ee544f71adc2..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_AMD64_windows_3.4.4.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_2.7.11.pickle b/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_2.7.11.pickle deleted file mode 100644 index 7af7e67ce8c43..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_2.7.11.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_3.4.4.pickle b/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_3.4.4.pickle deleted file mode 100644 index b4cce985f2f0b..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_3.4.4.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_3.5.3.pickle b/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_3.5.3.pickle deleted file mode 100644 index 537864af7028b..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_darwin_3.5.3.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_linux_2.7.11.pickle b/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_linux_2.7.11.pickle deleted file mode 100644 index 7af7e67ce8c43..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_linux_2.7.11.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_linux_3.4.4.pickle b/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_linux_3.4.4.pickle deleted file mode 100644 index 67a442c2be93b..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.0_x86_64_linux_3.4.4.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.1_AMD64_windows_2.7.11.pickle b/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.1_AMD64_windows_2.7.11.pickle deleted file mode 100644 index 2b91b9ab5552b..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.17.0/0.17.1_AMD64_windows_2.7.11.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.17.1/0.17.1_AMD64_windows_2.7.11.pickle b/pandas/tests/io/data/legacy_pickle/0.17.1/0.17.1_AMD64_windows_2.7.11.pickle deleted file mode 100644 index 2b91b9ab5552b..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.17.1/0.17.1_AMD64_windows_2.7.11.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.17.1/0.17.1_x86_64_darwin_2.7.11.pickle b/pandas/tests/io/data/legacy_pickle/0.17.1/0.17.1_x86_64_darwin_2.7.11.pickle deleted file mode 100644 index 7af7e67ce8c43..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.17.1/0.17.1_x86_64_darwin_2.7.11.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_AMD64_windows_2.7.11.pickle b/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_AMD64_windows_2.7.11.pickle deleted file mode 100644 index d244ce48b04c6..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_AMD64_windows_2.7.11.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_AMD64_windows_3.5.1.pickle b/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_AMD64_windows_3.5.1.pickle deleted file mode 100644 index 3733e16122709..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_AMD64_windows_3.5.1.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_x86_64_darwin_2.7.11.pickle b/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_x86_64_darwin_2.7.11.pickle deleted file mode 100644 index 3ce45c6949be0..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_x86_64_darwin_2.7.11.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_x86_64_darwin_3.5.1.pickle b/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_x86_64_darwin_3.5.1.pickle deleted file mode 100644 index 1eccef3903e01..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.18.0/0.18.0_x86_64_darwin_3.5.1.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.18.1/0.18.1_x86_64_darwin_2.7.12.pickle b/pandas/tests/io/data/legacy_pickle/0.18.1/0.18.1_x86_64_darwin_2.7.12.pickle deleted file mode 100644 index bb237f53476b5..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.18.1/0.18.1_x86_64_darwin_2.7.12.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_AMD64_windows_2.7.14.pickle b/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_AMD64_windows_2.7.14.pickle deleted file mode 100644 index ddd88f77aa2a4..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_AMD64_windows_2.7.14.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_2.7.12.pickle b/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_2.7.12.pickle deleted file mode 100644 index d702ab444df62..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_2.7.12.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_2.7.14.pickle b/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_2.7.14.pickle deleted file mode 100644 index 555be58cc33ac..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_2.7.14.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_3.6.1.pickle b/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_3.6.1.pickle deleted file mode 100644 index 75ea95ff402c4..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.19.2/0.19.2_x86_64_darwin_3.6.1.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.20.3/0.20.3_x86_64_darwin_2.7.14.pickle b/pandas/tests/io/data/legacy_pickle/0.20.3/0.20.3_x86_64_darwin_2.7.14.pickle deleted file mode 100644 index 963e533c4d2b4..0000000000000 Binary files a/pandas/tests/io/data/legacy_pickle/0.20.3/0.20.3_x86_64_darwin_2.7.14.pickle and /dev/null differ diff --git a/pandas/tests/io/data/legacy_pickle/0.18.1/0.18.1_x86_64_darwin_3.5.2.pickle b/pandas/tests/io/data/legacy_pickle/0.20.3/0.20.3_x86_64_darwin_3.5.2.pickle similarity index 85% rename from pandas/tests/io/data/legacy_pickle/0.18.1/0.18.1_x86_64_darwin_3.5.2.pickle rename to pandas/tests/io/data/legacy_pickle/0.20.3/0.20.3_x86_64_darwin_3.5.2.pickle index 20af597c57a1b..9777319465de6 100644 Binary files a/pandas/tests/io/data/legacy_pickle/0.18.1/0.18.1_x86_64_darwin_3.5.2.pickle and b/pandas/tests/io/data/legacy_pickle/0.20.3/0.20.3_x86_64_darwin_3.5.2.pickle differ diff --git a/pandas/tests/io/generate_legacy_storage_files.py b/pandas/tests/io/generate_legacy_storage_files.py index a4242ad18411b..5bb7fe8e6367d 100755 --- a/pandas/tests/io/generate_legacy_storage_files.py +++ b/pandas/tests/io/generate_legacy_storage_files.py @@ -4,10 +4,10 @@ self-contained to write legacy storage (pickle/msgpack) files To use this script. Create an environment where you want -generate pickles, say its for 0.18.1, with your pandas clone +generate pickles, say its for 0.20.3, with your pandas clone in ~/pandas -. activate pandas_0.18.1 +. activate pandas_0.20.3 cd ~/ $ python pandas/pandas/tests/io/generate_legacy_storage_files.py \ @@ -15,10 +15,10 @@ This script generates a storage file for the current arch, system, and python version - pandas version: 0.18.1 + pandas version: 0.20.3 output dir : pandas/pandas/tests/io/data/legacy_pickle/0.18.1/ storage format: pickle -created pickle file: 0.18.1_x86_64_darwin_3.5.2.pickle +created pickle file: 0.20.3_x86_64_darwin_3.5.2.pickle The idea here is you are using the *current* version of the generate_legacy_storage_files with an *older* version of pandas to @@ -45,7 +45,7 @@ import pandas from pandas import ( - Categorical, DataFrame, Index, MultiIndex, NaT, Period, Series, + Categorical, DataFrame, Index, MultiIndex, NaT, Period, RangeIndex, Series, SparseDataFrame, SparseSeries, Timestamp, bdate_range, date_range, period_range, timedelta_range, to_msgpack) @@ -118,9 +118,7 @@ def create_data(): uint=Index(np.arange(10, dtype=np.uint64)), timedelta=timedelta_range('00:00:00', freq='30T', periods=10)) - if _loose_version >= LooseVersion('0.18'): - from pandas import RangeIndex - index['range'] = RangeIndex(10) + index['range'] = RangeIndex(10) if _loose_version >= LooseVersion('0.21'): from pandas import interval_range @@ -191,14 +189,9 @@ def create_data(): nat=NaT, tz=Timestamp('2011-01-01', tz='US/Eastern')) - if _loose_version < LooseVersion('0.19.2'): - timestamp['freq'] = Timestamp('2011-01-01', offset='D') - timestamp['both'] = Timestamp('2011-01-01', tz='Asia/Tokyo', - offset='M') - else: - timestamp['freq'] = Timestamp('2011-01-01', freq='D') - timestamp['both'] = Timestamp('2011-01-01', tz='Asia/Tokyo', - freq='M') + timestamp['freq'] = Timestamp('2011-01-01', freq='D') + timestamp['both'] = Timestamp('2011-01-01', tz='Asia/Tokyo', + freq='M') off = {'DateOffset': DateOffset(years=1), 'DateOffset_h_ns': DateOffset(hour=6, nanoseconds=5824), @@ -239,14 +232,6 @@ def create_data(): def create_pickle_data(): data = create_data() - # Pre-0.14.1 versions generated non-unpicklable mixed-type frames and - # panels if their columns/items were non-unique. - if _loose_version < LooseVersion('0.14.1'): - del data['frame']['mixed_dup'] - del data['panel']['mixed_dup'] - if _loose_version < LooseVersion('0.17.0'): - del data['series']['period'] - del data['scalars']['period'] return data @@ -256,14 +241,6 @@ def _u(x): def create_msgpack_data(): data = create_data() - if _loose_version < LooseVersion('0.17.0'): - del data['frame']['mixed_dup'] - del data['panel']['mixed_dup'] - del data['frame']['dup'] - del data['panel']['dup'] - if _loose_version < LooseVersion('0.18.0'): - del data['series']['dt_tz'] - del data['frame']['dt_mixed_tzs'] # Not supported del data['sp_series'] del data['sp_frame'] @@ -272,7 +249,8 @@ def create_msgpack_data(): del data['frame']['cat_onecol'] del data['frame']['cat_and_float'] del data['scalars']['period'] - if _loose_version < LooseVersion('0.23.0'): + if _loose_version >= LooseVersion('0.21') and ( + _loose_version < LooseVersion('0.23.0')): del data['index']['interval'] del data['offsets'] return _u(data) @@ -285,7 +263,6 @@ def platform_name(): def write_legacy_pickles(output_dir): - # make sure we are < 0.13 compat (in py3) version = pandas.__version__ print("This script generates a storage file for the current arch, system, " diff --git a/pandas/tests/io/test_packers.py b/pandas/tests/io/test_packers.py index 9337d5916acc6..59fa9fbd02da1 100644 --- a/pandas/tests/io/test_packers.py +++ b/pandas/tests/io/test_packers.py @@ -1,5 +1,4 @@ import datetime -from distutils.version import LooseVersion import glob from io import BytesIO import os @@ -84,7 +83,6 @@ def check_arbitrary(a, b): assert(a == b) -@pytest.mark.filterwarnings("ignore:\\nPanel:FutureWarning") class TestPackers: def setup_method(self, method): @@ -99,7 +97,6 @@ def encode_decode(self, x, compress=None, **kwargs): return read_msgpack(p, **kwargs) -@pytest.mark.filterwarnings("ignore:\\nPanel:FutureWarning") class TestAPI(TestPackers): def test_string_io(self): @@ -463,7 +460,6 @@ def test_basic(self): assert_categorical_equal(i, i_rec) -@pytest.mark.filterwarnings("ignore:\\nPanel:FutureWarning") class TestNDFrame(TestPackers): def setup_method(self, method): @@ -842,7 +838,6 @@ def legacy_packer(request, datapath): return datapath(request.param) -@pytest.mark.filterwarnings("ignore:\\nPanel:FutureWarning") @pytest.mark.filterwarnings("ignore:Sparse:FutureWarning") class TestMsgpack: """ @@ -858,15 +853,11 @@ class TestMsgpack: minimum_structure = {'series': ['float', 'int', 'mixed', 'ts', 'mi', 'dup'], 'frame': ['float', 'int', 'mixed', 'mi'], - 'panel': ['float'], 'index': ['int', 'date', 'period'], 'mi': ['reg2']} def check_min_structure(self, data, version): for typ, v in self.minimum_structure.items(): - if typ == "panel": - # FIXME: kludge; get this key out of the legacy file - continue assert typ in data, '"{0}" not found in unpacked data'.format(typ) for kind in v: @@ -874,15 +865,7 @@ def check_min_structure(self, data, version): assert kind in data[typ], msg def compare(self, current_data, all_data, vf, version): - # GH12277 encoding default used to be latin-1, now utf-8 - if LooseVersion(version) < LooseVersion('0.18.0'): - data = read_msgpack(vf, encoding='latin-1') - else: - data = read_msgpack(vf) - - if "panel" in data: - # FIXME: kludge; get the key out of the stored file - del data["panel"] + data = read_msgpack(vf) self.check_min_structure(data, version) for typ, dv in data.items(): @@ -909,33 +892,16 @@ def compare(self, current_data, all_data, vf, version): return data def compare_series_dt_tz(self, result, expected, typ, version): - # 8260 - # dtype is object < 0.17.0 - if LooseVersion(version) < LooseVersion('0.17.0'): - expected = expected.astype(object) - tm.assert_series_equal(result, expected) - else: - tm.assert_series_equal(result, expected) + tm.assert_series_equal(result, expected) def compare_frame_dt_mixed_tzs(self, result, expected, typ, version): - # 8260 - # dtype is object < 0.17.0 - if LooseVersion(version) < LooseVersion('0.17.0'): - expected = expected.astype(object) - tm.assert_frame_equal(result, expected) - else: - tm.assert_frame_equal(result, expected) + tm.assert_frame_equal(result, expected) def test_msgpacks_legacy(self, current_packers_data, all_packers_data, legacy_packer, datapath): version = os.path.basename(os.path.dirname(legacy_packer)) - # GH12142 0.17 files packed in P2 can't be read in P3 - if (version.startswith('0.17.') and - legacy_packer.split('.')[-4][-1] == '2'): - msg = "Files packed in Py2 can't be read in Py3 ({})" - pytest.skip(msg.format(version)) try: with catch_warnings(record=True): self.compare(current_packers_data, all_packers_data, diff --git a/pandas/tests/io/test_pickle.py b/pandas/tests/io/test_pickle.py index b115a08d3b0d3..eb912908d28f4 100644 --- a/pandas/tests/io/test_pickle.py +++ b/pandas/tests/io/test_pickle.py @@ -11,7 +11,6 @@ 3. Move the created pickle to "data/legacy_pickle/" directory. """ import bz2 -from distutils.version import LooseVersion import glob import gzip import lzma @@ -69,18 +68,8 @@ def compare(data, vf, version): m = globals() for typ, dv in data.items(): - if typ == "panel": - # FIXME: kludge; get this key out of the legacy file - continue - for dt, result in dv.items(): - try: - expected = data[typ][dt] - except (KeyError): - if version in ('0.10.1', '0.11.0') and dt == 'reg': - break - else: - raise + expected = data[typ][dt] # use a specific comparator # if available @@ -92,12 +81,7 @@ def compare(data, vf, version): def compare_sp_series_ts(res, exp, typ, version): - # SparseTimeSeries integrated into SparseSeries in 0.12.0 - # and deprecated in 0.17.0 - if version and LooseVersion(version) <= LooseVersion("0.12.0"): - tm.assert_sp_series_equal(res, exp, check_series_type=False) - else: - tm.assert_sp_series_equal(res, exp) + tm.assert_sp_series_equal(res, exp) def compare_series_ts(result, expected, typ, version): @@ -121,47 +105,19 @@ def compare_series_ts(result, expected, typ, version): def compare_series_dt_tz(result, expected, typ, version): - # 8260 - # dtype is object < 0.17.0 - if LooseVersion(version) < LooseVersion('0.17.0'): - expected = expected.astype(object) - tm.assert_series_equal(result, expected) - else: - tm.assert_series_equal(result, expected) + tm.assert_series_equal(result, expected) def compare_series_cat(result, expected, typ, version): - # Categorical dtype is added in 0.15.0 - # ordered is changed in 0.16.0 - if LooseVersion(version) < LooseVersion('0.15.0'): - tm.assert_series_equal(result, expected, check_dtype=False, - check_categorical=False) - elif LooseVersion(version) < LooseVersion('0.16.0'): - tm.assert_series_equal(result, expected, check_categorical=False) - else: - tm.assert_series_equal(result, expected) + tm.assert_series_equal(result, expected) def compare_frame_dt_mixed_tzs(result, expected, typ, version): - # 8260 - # dtype is object < 0.17.0 - if LooseVersion(version) < LooseVersion('0.17.0'): - expected = expected.astype(object) - tm.assert_frame_equal(result, expected) - else: - tm.assert_frame_equal(result, expected) + tm.assert_frame_equal(result, expected) def compare_frame_cat_onecol(result, expected, typ, version): - # Categorical dtype is added in 0.15.0 - # ordered is changed in 0.16.0 - if LooseVersion(version) < LooseVersion('0.15.0'): - tm.assert_frame_equal(result, expected, check_dtype=False, - check_categorical=False) - elif LooseVersion(version) < LooseVersion('0.16.0'): - tm.assert_frame_equal(result, expected, check_categorical=False) - else: - tm.assert_frame_equal(result, expected) + tm.assert_frame_equal(result, expected) def compare_frame_cat_and_float(result, expected, typ, version): @@ -177,11 +133,7 @@ def compare_index_period(result, expected, typ, version): def compare_sp_frame_float(result, expected, typ, version): - if LooseVersion(version) <= LooseVersion('0.18.1'): - tm.assert_sp_frame_equal(result, expected, exact_indices=False, - check_dtype=False) - else: - tm.assert_sp_frame_equal(result, expected) + tm.assert_sp_frame_equal(result, expected) files = glob.glob(os.path.join(os.path.dirname(__file__), "data",