Skip to content

Commit d48a8fa

Browse files
committed
Fixup
1 parent e159ef2 commit d48a8fa

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

pandas/core/internals/managers.py

-1
Original file line numberDiff line numberDiff line change
@@ -2080,7 +2080,6 @@ def concatenate_block_managers(mgrs_indexers, axes, concat_axis, copy):
20802080
concat_plan = combine_concat_plans(concat_plans, concat_axis)
20812081
blocks = []
20822082

2083-
import pdb; pdb.set_trace()
20842083
for placement, join_units in concat_plan:
20852084

20862085
if len(join_units) == 1 and not join_units[0].indexers:

pandas/tests/sparse/test_combine_concat.py

+17-18
Original file line numberDiff line numberDiff line change
@@ -286,27 +286,26 @@ def test_concat_different_columns_sort_warns(self):
286286

287287
def test_concat_different_columns(self):
288288
# fill_value = np.nan
289-
# sparse = self.dense1.to_sparse()
290-
# sparse3 = self.dense3.to_sparse()
291-
292-
# res = pd.concat([sparse, sparse3], sort=True)
293-
# exp = pd.concat([self.dense1, self.dense3], sort=True).to_sparse()
294-
# tm.assert_sp_frame_equal(res, exp, check_kind=False)
295-
#
296-
# res = pd.concat([sparse3, sparse], sort=True)
297-
# exp = pd.concat([self.dense3, self.dense1], sort=True).to_sparse()
298-
# exp._default_fill_value = np.nan
299-
# tm.assert_sp_frame_equal(res, exp, check_kind=False)
300-
#
301-
# # fill_value = 0
289+
sparse = self.dense1.to_sparse()
290+
sparse3 = self.dense3.to_sparse()
291+
292+
res = pd.concat([sparse, sparse3], sort=True)
293+
exp = pd.concat([self.dense1, self.dense3], sort=True).to_sparse()
294+
tm.assert_sp_frame_equal(res, exp, check_kind=False)
295+
296+
res = pd.concat([sparse3, sparse], sort=True)
297+
exp = pd.concat([self.dense3, self.dense1], sort=True).to_sparse()
298+
exp._default_fill_value = np.nan
299+
tm.assert_sp_frame_equal(res, exp, check_kind=False)
300+
301+
@pytest.mark.xfail(reason="concat sparse and dense", strict=True)
302+
def test_concat_different_columns_buggy(self):
303+
# I'm confused here. We're getting different fill values
304+
# and so different sparse values for C (all NaN and not present).
305+
# fill_value = 0
302306
sparse = self.dense1.to_sparse(fill_value=0)
303307
sparse3 = self.dense3.to_sparse(fill_value=0)
304308

305-
# this test is buggy. from here on out
306-
# exp doesn't handle C (all NaN) correctly.
307-
# We correctly don't have any sparse values since the
308-
# values are all NaN, and the fill_value is 0.
309-
# raise pytest.xfail("Test is buggy.")
310309
res = pd.concat([sparse, sparse3], sort=True)
311310
exp = (pd.concat([self.dense1, self.dense3], sort=True)
312311
.to_sparse(fill_value=0))

0 commit comments

Comments
 (0)