Skip to content

Commit e603d3d

Browse files
committed
fixup 33bc8f8
1 parent afde64d commit e603d3d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pandas/tests/sparse/series/test_series.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
from pandas import (Series, DataFrame, bdate_range,
1313
isna, compat, _np_version_under1p12)
14+
from pandas.errors import PerformanceWarning
1415
from pandas.tseries.offsets import BDay
1516
import pandas.util.testing as tm
1617
import pandas.util._test_decorators as td
@@ -1231,7 +1232,6 @@ def test_concat_axis1(self):
12311232
exp = pd.SparseDataFrame(exp)
12321233
tm.assert_sp_frame_equal(res, exp)
12331234

1234-
@pytest.mark.xfail(reason="TODO", strict=True)
12351235
def test_concat_different_fill(self):
12361236
val1 = np.array([1, 2, np.nan, np.nan, 0, np.nan])
12371237
val2 = np.array([3, np.nan, 4, 0, 0])
@@ -1240,12 +1240,14 @@ def test_concat_different_fill(self):
12401240
sparse1 = pd.SparseSeries(val1, name='x', kind=kind)
12411241
sparse2 = pd.SparseSeries(val2, name='y', kind=kind, fill_value=0)
12421242

1243-
res = pd.concat([sparse1, sparse2])
1243+
with tm.assert_produces_warning(PerformanceWarning):
1244+
res = pd.concat([sparse1, sparse2])
12441245
exp = pd.concat([pd.Series(val1), pd.Series(val2)])
12451246
exp = pd.SparseSeries(exp, kind=kind)
12461247
tm.assert_sp_series_equal(res, exp)
12471248

1248-
res = pd.concat([sparse2, sparse1])
1249+
with tm.assert_produces_warning(PerformanceWarning):
1250+
res = pd.concat([sparse2, sparse1])
12491251
exp = pd.concat([pd.Series(val2), pd.Series(val1)])
12501252
exp = pd.SparseSeries(exp, kind=kind, fill_value=0)
12511253
tm.assert_sp_series_equal(res, exp)
@@ -1263,20 +1265,21 @@ def test_concat_axis1_different_fill(self):
12631265
assert isinstance(res, pd.SparseDataFrame)
12641266
tm.assert_frame_equal(res.to_dense(), exp)
12651267

1266-
@pytest.mark.xfail(reason="TODO", strict=True)
12671268
def test_concat_different_kind(self):
12681269
val1 = np.array([1, 2, np.nan, np.nan, 0, np.nan])
12691270
val2 = np.array([3, np.nan, 4, 0, 0])
12701271

12711272
sparse1 = pd.SparseSeries(val1, name='x', kind='integer')
12721273
sparse2 = pd.SparseSeries(val2, name='y', kind='block', fill_value=0)
12731274

1274-
res = pd.concat([sparse1, sparse2])
1275+
with tm.assert_produces_warning(PerformanceWarning):
1276+
res = pd.concat([sparse1, sparse2])
12751277
exp = pd.concat([pd.Series(val1), pd.Series(val2)])
12761278
exp = pd.SparseSeries(exp, kind='integer')
12771279
tm.assert_sp_series_equal(res, exp)
12781280

1279-
res = pd.concat([sparse2, sparse1])
1281+
with tm.assert_produces_warning(PerformanceWarning):
1282+
res = pd.concat([sparse2, sparse1])
12801283
exp = pd.concat([pd.Series(val2), pd.Series(val1)])
12811284
exp = pd.SparseSeries(exp, kind='block', fill_value=0)
12821285
tm.assert_sp_series_equal(res, exp)

0 commit comments

Comments
 (0)