Skip to content

Commit 5c58daa

Browse files
committed
fix: test if it is a dense object not sparse
1 parent 87e7c45 commit 5c58daa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pandas/tests/sparse/test_combine_concat.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,17 @@ def test_concat_sparse_dense(self):
344344

345345
res = pd.concat([self.dense3, sparse], axis=1)
346346
exp = pd.concat([self.dense3, self.dense1], axis=1)
347-
assert isinstance(res, pd.SparseDataFrame)
347+
# See GH18914 and #18686 for why this should be
348+
# A DataFrame
349+
assert isinstance(res, pd.DataFrame)
350+
for column in self.dense3.columns:
351+
tm.assert_series_equal(res[column], exp[column])
352+
348353
tm.assert_frame_equal(res, exp)
349354

350355
res = pd.concat([sparse, self.dense3], axis=1)
351356
exp = pd.concat([self.dense1, self.dense3], axis=1)
352-
assert isinstance(res, pd.SparseDataFrame)
357+
assert isinstance(res, pd.DataFrame)
358+
for column in self.dense3.columns:
359+
tm.assert_series_equal(res[column], exp[column])
353360
tm.assert_frame_equal(res, exp)

0 commit comments

Comments
 (0)