From 8c4e28fa7d2d952c0f6f6abc044b7c0fff78058f Mon Sep 17 00:00:00 2001 From: rivera-fernando Date: Wed, 13 May 2020 21:04:22 -0400 Subject: [PATCH 1/3] TST Added test for issue #32409, json containing dicts containing the key last_status_change_at --- pandas/tests/io/json/test_pandas.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandas/tests/io/json/test_pandas.py b/pandas/tests/io/json/test_pandas.py index 137e4c991d080..78fd4796a7ccf 100644 --- a/pandas/tests/io/json/test_pandas.py +++ b/pandas/tests/io/json/test_pandas.py @@ -704,6 +704,15 @@ def test_series_with_dtype(self): expected = Series([4] * 3) tm.assert_series_equal(result, expected) + def test_unhashable_dict(self): + df = pd.DataFrame( + [ + {"last_status_change_at": {"a": "1"}}, + {"last_status_change_at": {"a": "2"}}, + ] + ) + df.describe() + @pytest.mark.parametrize( "dtype,expected", [ From 00ad4f37085520c0f2ccaa691b717a4297fdbbca Mon Sep 17 00:00:00 2001 From: rivera-fernando Date: Thu, 14 May 2020 19:30:01 -0400 Subject: [PATCH 2/3] TST: Added test for json containing key last_status_change_at --- pandas/tests/frame/methods/test_describe.py | 10 ++++++++++ pandas/tests/io/json/test_pandas.py | 9 --------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pandas/tests/frame/methods/test_describe.py b/pandas/tests/frame/methods/test_describe.py index b61d0d28e2fba..c5cba401376f5 100644 --- a/pandas/tests/frame/methods/test_describe.py +++ b/pandas/tests/frame/methods/test_describe.py @@ -298,3 +298,13 @@ def test_describe_percentiles_integer_idx(self): ], ) tm.assert_frame_equal(result, expected) + + +def test__unhashable_dict(): + result = pd.DataFrame( + [{"last_status_change_at": {"a": "1"}}, {"last_status_change_at": {"a": "2"}}] + ) + expected = pd.DataFrame( + [{"last_status_change_at": {"a": "1"}}, {"last_status_change_at": {"a": "2"}}] + ) + tm.assert_frame_equal(result, expected) diff --git a/pandas/tests/io/json/test_pandas.py b/pandas/tests/io/json/test_pandas.py index 78fd4796a7ccf..137e4c991d080 100644 --- a/pandas/tests/io/json/test_pandas.py +++ b/pandas/tests/io/json/test_pandas.py @@ -704,15 +704,6 @@ def test_series_with_dtype(self): expected = Series([4] * 3) tm.assert_series_equal(result, expected) - def test_unhashable_dict(self): - df = pd.DataFrame( - [ - {"last_status_change_at": {"a": "1"}}, - {"last_status_change_at": {"a": "2"}}, - ] - ) - df.describe() - @pytest.mark.parametrize( "dtype,expected", [ From 36ab35b83e90c8e8e71a6425f77a8ac715ae8d2c Mon Sep 17 00:00:00 2001 From: rivera-fernando Date: Sat, 16 May 2020 20:55:37 -0400 Subject: [PATCH 3/3] TST: Added test for json containing the key last_status_change_at --- pandas/tests/frame/methods/test_describe.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/tests/frame/methods/test_describe.py b/pandas/tests/frame/methods/test_describe.py index c5cba401376f5..d448151961dcc 100644 --- a/pandas/tests/frame/methods/test_describe.py +++ b/pandas/tests/frame/methods/test_describe.py @@ -300,7 +300,8 @@ def test_describe_percentiles_integer_idx(self): tm.assert_frame_equal(result, expected) -def test__unhashable_dict(): +def test_unhashable_dict(): + # GH#32409 result = pd.DataFrame( [{"last_status_change_at": {"a": "1"}}, {"last_status_change_at": {"a": "2"}}] )