From 1810fa59b3fd7a2b7f014ae5c5531a79d6fe7b46 Mon Sep 17 00:00:00 2001 From: reshamas Date: Sat, 14 Nov 2020 13:57:46 -0500 Subject: [PATCH 1/6] namespace consistency for test_dtype.py --- pandas/tests/arrays/sparse/test_dtype.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/arrays/sparse/test_dtype.py b/pandas/tests/arrays/sparse/test_dtype.py index 16b4dd5c95932..8cd0d29a34ec8 100644 --- a/pandas/tests/arrays/sparse/test_dtype.py +++ b/pandas/tests/arrays/sparse/test_dtype.py @@ -200,10 +200,10 @@ def test_update_dtype_raises(original, dtype, expected_error_msg): def test_repr(): # GH-34352 - result = str(pd.SparseDtype("int64", fill_value=0)) + result = str(SparseDtype("int64", fill_value=0)) expected = "Sparse[int64, 0]" assert result == expected - result = str(pd.SparseDtype(object, fill_value="0")) + result = str(SparseDtype(object, fill_value="0")) expected = "Sparse[object, '0']" assert result == expected From a0183de3893eaf7e949972b9b044f61f8509e077 Mon Sep 17 00:00:00 2001 From: reshamas Date: Sat, 14 Nov 2020 14:16:51 -0500 Subject: [PATCH 2/6] namespace inconsistency fix to test_interval.py --- pandas/tests/arithmetic/test_interval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/arithmetic/test_interval.py b/pandas/tests/arithmetic/test_interval.py index 30a23d8563ef8..915322658af37 100644 --- a/pandas/tests/arithmetic/test_interval.py +++ b/pandas/tests/arithmetic/test_interval.py @@ -133,7 +133,7 @@ def test_compare_scalar_na(self, op, array, nulls_fixture, request): result = op(array, nulls_fixture) expected = self.elementwise_comparison(op, array, nulls_fixture) - if nulls_fixture is pd.NA and array.dtype != pd.IntervalDtype("int64"): + if nulls_fixture is pd.NA and array.dtype != IntervalDtype("int64"): mark = pytest.mark.xfail( reason="broken for non-integer IntervalArray; see GH 31882" ) @@ -290,6 +290,6 @@ def test_index_series_compat(self, op, constructor, expected_type, assert_func): def test_comparison_operations(self, scalars): # GH #28981 expected = Series([False, False]) - s = Series([pd.Interval(0, 1), pd.Interval(1, 2)], dtype="interval") + s = Series([Interval(0, 1), Interval(1, 2)], dtype="interval") result = s == scalars tm.assert_series_equal(result, expected) From ba5229b7f53fb8f99cc99cfa58635950f0dfdc44 Mon Sep 17 00:00:00 2001 From: reshamas Date: Sat, 14 Nov 2020 14:32:36 -0500 Subject: [PATCH 3/6] reverting changes to test_dtype.py --- pandas/tests/arrays/sparse/test_dtype.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/arrays/sparse/test_dtype.py b/pandas/tests/arrays/sparse/test_dtype.py index 8cd0d29a34ec8..16b4dd5c95932 100644 --- a/pandas/tests/arrays/sparse/test_dtype.py +++ b/pandas/tests/arrays/sparse/test_dtype.py @@ -200,10 +200,10 @@ def test_update_dtype_raises(original, dtype, expected_error_msg): def test_repr(): # GH-34352 - result = str(SparseDtype("int64", fill_value=0)) + result = str(pd.SparseDtype("int64", fill_value=0)) expected = "Sparse[int64, 0]" assert result == expected - result = str(SparseDtype(object, fill_value="0")) + result = str(pd.SparseDtype(object, fill_value="0")) expected = "Sparse[object, '0']" assert result == expected From b5e63fdb6e73f063ba0446911d29d2d858ccd362 Mon Sep 17 00:00:00 2001 From: reshamas Date: Sat, 14 Nov 2020 14:43:05 -0500 Subject: [PATCH 4/6] fix flake8 error --- pandas/tests/arithmetic/test_interval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/arithmetic/test_interval.py b/pandas/tests/arithmetic/test_interval.py index 915322658af37..6dc3b3b13dd0c 100644 --- a/pandas/tests/arithmetic/test_interval.py +++ b/pandas/tests/arithmetic/test_interval.py @@ -133,7 +133,7 @@ def test_compare_scalar_na(self, op, array, nulls_fixture, request): result = op(array, nulls_fixture) expected = self.elementwise_comparison(op, array, nulls_fixture) - if nulls_fixture is pd.NA and array.dtype != IntervalDtype("int64"): + if nulls_fixture is pd.NA and array.dtype != pd.IntervalDtype("int64"): mark = pytest.mark.xfail( reason="broken for non-integer IntervalArray; see GH 31882" ) From 33595ef5abbdc6de305413dc907fbf2e56fb7ea4 Mon Sep 17 00:00:00 2001 From: reshamas Date: Sat, 14 Nov 2020 14:46:37 -0500 Subject: [PATCH 5/6] fix Interval change --- pandas/tests/arithmetic/test_interval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/arithmetic/test_interval.py b/pandas/tests/arithmetic/test_interval.py index 6dc3b3b13dd0c..915322658af37 100644 --- a/pandas/tests/arithmetic/test_interval.py +++ b/pandas/tests/arithmetic/test_interval.py @@ -133,7 +133,7 @@ def test_compare_scalar_na(self, op, array, nulls_fixture, request): result = op(array, nulls_fixture) expected = self.elementwise_comparison(op, array, nulls_fixture) - if nulls_fixture is pd.NA and array.dtype != pd.IntervalDtype("int64"): + if nulls_fixture is pd.NA and array.dtype != IntervalDtype("int64"): mark = pytest.mark.xfail( reason="broken for non-integer IntervalArray; see GH 31882" ) From a2bc4715e031654eebd26dc849aa9a7e853a0510 Mon Sep 17 00:00:00 2001 From: reshamas Date: Sat, 14 Nov 2020 14:49:21 -0500 Subject: [PATCH 6/6] adding back pd.IntervalDtype --- pandas/tests/arithmetic/test_interval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/arithmetic/test_interval.py b/pandas/tests/arithmetic/test_interval.py index 915322658af37..6dc3b3b13dd0c 100644 --- a/pandas/tests/arithmetic/test_interval.py +++ b/pandas/tests/arithmetic/test_interval.py @@ -133,7 +133,7 @@ def test_compare_scalar_na(self, op, array, nulls_fixture, request): result = op(array, nulls_fixture) expected = self.elementwise_comparison(op, array, nulls_fixture) - if nulls_fixture is pd.NA and array.dtype != IntervalDtype("int64"): + if nulls_fixture is pd.NA and array.dtype != pd.IntervalDtype("int64"): mark = pytest.mark.xfail( reason="broken for non-integer IntervalArray; see GH 31882" )