Skip to content

Commit f61b5e3

Browse files
committed
Round 3
1 parent 5418dd5 commit f61b5e3

File tree

3 files changed

+1
-45
lines changed

3 files changed

+1
-45
lines changed

pandas/tests/dtypes/test_common.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
UNSIGNED_EA_INT_DTYPES,
2222
UNSIGNED_INT_DTYPES,
2323
)
24-
from pandas.core.sparse.api import SparseDtype
2524
import pandas.util.testing as tm
2625

2726
ignore_sparse_warning = pytest.mark.filterwarnings("ignore:Sparse:FutureWarning")
@@ -182,7 +181,6 @@ def test_is_object():
182181
@ignore_sparse_warning
183182
def test_is_sparse(check_scipy):
184183
assert com.is_sparse(pd.SparseArray([1, 2, 3]))
185-
assert com.is_sparse(pd.SparseSeries([1, 2, 3]))
186184

187185
assert not com.is_sparse(np.array([1, 2, 3]))
188186

@@ -200,7 +198,6 @@ def test_is_scipy_sparse():
200198
assert com.is_scipy_sparse(bsr_matrix([1, 2, 3]))
201199

202200
assert not com.is_scipy_sparse(pd.SparseArray([1, 2, 3]))
203-
assert not com.is_scipy_sparse(pd.SparseSeries([1, 2, 3]))
204201

205202

206203
def test_is_categorical():
@@ -596,7 +593,6 @@ def test_is_extension_type(check_scipy):
596593
assert com.is_extension_type(cat)
597594
assert com.is_extension_type(pd.Series(cat))
598595
assert com.is_extension_type(pd.SparseArray([1, 2, 3]))
599-
assert com.is_extension_type(pd.SparseSeries([1, 2, 3]))
600596
assert com.is_extension_type(pd.DatetimeIndex(["2000"], tz="US/Eastern"))
601597

602598
dtype = DatetimeTZDtype("ns", tz="US/Eastern")
@@ -664,14 +660,6 @@ def test__get_dtype(input_param, result):
664660
assert com._get_dtype(input_param) == result
665661

666662

667-
@ignore_sparse_warning
668-
def test__get_dtype_sparse():
669-
ser = pd.SparseSeries([1, 2], dtype="int32")
670-
expected = SparseDtype("int32")
671-
assert com._get_dtype(ser) == expected
672-
assert com._get_dtype(ser.dtype) == expected
673-
674-
675663
@pytest.mark.parametrize(
676664
"input_param,expected_error_message",
677665
[
@@ -723,11 +711,3 @@ def test__get_dtype_fails(input_param, expected_error_message):
723711
)
724712
def test__is_dtype_type(input_param, result):
725713
assert com._is_dtype_type(input_param, lambda tipo: tipo == result)
726-
727-
728-
@ignore_sparse_warning
729-
def test__is_dtype_type_sparse():
730-
ser = pd.SparseSeries([1, 2], dtype="int32")
731-
result = np.dtype("int32")
732-
assert com._is_dtype_type(ser, lambda tipo: tipo == result)
733-
assert com._is_dtype_type(ser.dtype, lambda tipo: tipo == result)

pandas/tests/dtypes/test_generic.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from warnings import catch_warnings, simplefilter
1+
from warnings import catch_warnings
22

33
import numpy as np
44

@@ -17,11 +17,6 @@ class TestABCClasses:
1717
categorical = pd.Categorical([1, 2, 3], categories=[2, 3, 1])
1818
categorical_df = pd.DataFrame({"values": [1, 2, 3]}, index=categorical)
1919
df = pd.DataFrame({"names": ["a", "b", "c"]}, index=multi_index)
20-
with catch_warnings():
21-
simplefilter("ignore", FutureWarning)
22-
sparse_series = pd.Series([1, 2, 3]).to_sparse()
23-
sparse_frame = pd.SparseDataFrame({"a": [1, -1, None]})
24-
2520
sparse_array = pd.SparseArray(np.random.randn(10))
2621
datetime_array = pd.core.arrays.DatetimeArray(datetime_index)
2722
timedelta_array = pd.core.arrays.TimedeltaArray(timedelta_index)

pandas/tests/io/json/test_pandas.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,25 +1296,6 @@ def test_datetime_tz(self):
12961296
s_naive = Series(tz_naive)
12971297
assert stz.to_json() == s_naive.to_json()
12981298

1299-
@pytest.mark.filterwarnings("ignore:Sparse:FutureWarning")
1300-
@pytest.mark.filterwarnings("ignore:DataFrame.to_sparse:FutureWarning")
1301-
@pytest.mark.filterwarnings("ignore:Series.to_sparse:FutureWarning")
1302-
def test_sparse(self):
1303-
# GH4377 df.to_json segfaults with non-ndarray blocks
1304-
df = pd.DataFrame(np.random.randn(10, 4))
1305-
df.loc[:8] = np.nan
1306-
1307-
sdf = df.to_sparse()
1308-
expected = df.to_json()
1309-
assert expected == sdf.to_json()
1310-
1311-
s = pd.Series(np.random.randn(10))
1312-
s.loc[:8] = np.nan
1313-
ss = s.to_sparse()
1314-
1315-
expected = s.to_json()
1316-
assert expected == ss.to_json()
1317-
13181299
def test_tz_is_utc(self):
13191300
from pandas.io.json import dumps
13201301

0 commit comments

Comments
 (0)