From e7c9881bf28ee6fe9c9be52297d606c570196595 Mon Sep 17 00:00:00 2001 From: ikedaosushi Date: Thu, 13 Aug 2020 01:49:21 +0900 Subject: [PATCH 1/4] ENH: GH-35611 Tests for top-level Pandas functions serializable --- pandas/tests/test_common.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py index bcfed2d0d3a10..cec8dfaddabeb 100644 --- a/pandas/tests/test_common.py +++ b/pandas/tests/test_common.py @@ -10,6 +10,7 @@ import pandas as pd from pandas import Series, Timestamp +import pandas._testing as tm from pandas.core import ops import pandas.core.common as com @@ -157,3 +158,10 @@ def test_version_tag(): raise ValueError( "No git tags exist, please sync tags between upstream and your repo" ) + + +def test_serializable(): + for name, obj in pd.__dict__.items(): + if callable(obj): + unpickled = tm.round_trip_pickle(obj) + assert type(obj) == type(unpickled) From 0c16953a9888441b9c5ea9242ec5f838ddff340b Mon Sep 17 00:00:00 2001 From: ikedaosushi Date: Thu, 13 Aug 2020 14:11:50 +0900 Subject: [PATCH 2/4] Commit for CI From b178465fae7041ddf5d92d7192d3ca96f707ae2c Mon Sep 17 00:00:00 2001 From: ikedaosushi Date: Sat, 15 Aug 2020 15:47:16 +0900 Subject: [PATCH 3/4] Apply the review comment --- pandas/tests/test_common.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py index cec8dfaddabeb..3d45a1f7389b7 100644 --- a/pandas/tests/test_common.py +++ b/pandas/tests/test_common.py @@ -160,8 +160,10 @@ def test_version_tag(): ) -def test_serializable(): - for name, obj in pd.__dict__.items(): - if callable(obj): - unpickled = tm.round_trip_pickle(obj) - assert type(obj) == type(unpickled) +@pytest.mark.parametrize( + "obj", [(obj,) for obj in pd.__dict__.values() if callable(obj)] +) +def test_serializable(obj): + # GH 35611 + unpickled = tm.round_trip_pickle(obj) + assert type(obj) == type(unpickled) From f8215c426c7ca3d2c2c081e484574bf9809330ab Mon Sep 17 00:00:00 2001 From: ikedaosushi Date: Sat, 15 Aug 2020 17:44:05 +0900 Subject: [PATCH 4/4] Commit for CI