Skip to content

Commit 7b34c07

Browse files
committed
FIX: Cleanup messed up files for PR
1 parent 2612dcc commit 7b34c07

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

doc/source/whatsnew/v0.23.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ Reshaping
353353
- Bug in :func:`Series.rank` where ``Series`` containing ``NaT`` modifies the ``Series`` inplace (:issue:`18521`)
354354
- Bug in :func:`cut` which fails when using readonly arrays (:issue:`18773`)
355355
- Bug in :func:`Dataframe.pivot_table` which fails when the ``aggfunc`` arg is of type string. The behavior is now consistent with other methods like ``agg`` and ``apply`` (:issue:`18713`)
356-
- Bug in :func:`get_dummies` which doesn't cast all columns as sparse which causes reindex to fail. (:issue:`18914`)
356+
- Bug in :func:`pandas.core.dtypes.concat._get_series_result_type` which returns SparseDataFrame even if not all contained in Frame are sparse. (:issue:`18914`)
357357

358358

359359
Numeric

pandas/core/internals.py

-5
Original file line numberDiff line numberDiff line change
@@ -2756,11 +2756,6 @@ class SparseBlock(NonConsolidatableMixIn, Block):
27562756
_holder = SparseArray
27572757
_concatenator = staticmethod(_concat._concat_sparse)
27582758

2759-
def __init__(self, values, placement, ndim=None, fastpath=False, **kwargs):
2760-
super(SparseBlock, self).__init__(self._holder(values),
2761-
placement, ndim=ndim,
2762-
fastpath=fastpath, **kwargs)
2763-
27642759
@property
27652760
def shape(self):
27662761
return (len(self.mgr_locs), self.sp_index.length)

pandas/core/sparse/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from pandas.core.dtypes.cast import maybe_upcast, find_common_type
1515
from pandas.core.dtypes.common import _ensure_platform_int, is_scipy_sparse
1616

17-
from pandas.core.common import _try_sort, is_sparse
17+
from pandas.core.common import _try_sort
1818
from pandas.compat.numpy import function as nv
1919
from pandas.core.index import Index, MultiIndex, _ensure_index
2020
from pandas.core.series import Series

pandas/tests/reshape/test_reshape.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def test_dataframe_dummies_preserve_categorical_dtype(self, dtype):
454454

455455
tm.assert_frame_equal(result, expected)
456456

457-
def test_get_dummies_sparsify_all_columns(self):
457+
def test_get_dummies_dont_sparsify_all_columns(self):
458458
# GH18914
459459
df = DataFrame.from_items([('GDP', [1, 2]), ('Nation', ['AB', 'CD'])])
460460
df = get_dummies(df, columns=['Nation'], sparse=True)

pandas/tests/sparse/test_array.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def test_to_dense(self):
465465
with tm.assert_produces_warning(FutureWarning,
466466
check_stacklevel=False):
467467
SparseArray(vals).to_dense(fill=2)
468-
468+
469469
def test_getitem(self):
470470
def _checkit(i):
471471
assert_almost_equal(self.arr[i], self.arr.values[i])

pandas/tests/sparse/test_frame.py

+3
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ def test_density(self):
322322

323323
assert df.density == 0.75
324324

325+
def test_sparse_to_dense(self):
326+
pass
327+
325328
def test_sparse_series_ops(self):
326329
self._check_frame_ops(self.frame)
327330

0 commit comments

Comments
 (0)