Skip to content

Commit 07bb2ae

Browse files
committed
GH refs
1 parent 572e923 commit 07bb2ae

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

doc/source/whatsnew/v2.3.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ Conversion
107107

108108
Strings
109109
^^^^^^^
110+
- Bug in :meth:`DataFrame.sum` with ``axis=1``, :meth:`.DataFrameGroupBy.sum` or :meth:`.SeriesGroupBy.sum` with ``skipna=True``, and :meth:`.Resampler.sum` on :class:`StringDtype` with all NA values resulted in ``0`` and is now the empty string ``""`` (:issue:`60229`)
110111
- Bug in :meth:`Series.__pos__` and :meth:`DataFrame.__pos__` did not raise for :class:`StringDtype` with ``storage="pyarrow"`` (:issue:`60710`)
111112
- Bug in :meth:`Series.rank` for :class:`StringDtype` with ``storage="pyarrow"`` incorrectly returning integer results in case of ``method="average"`` and raising an error if it would truncate results (:issue:`59768`)
112113
- Bug in :meth:`Series.replace` with :class:`StringDtype` when replacing with a non-string value was not upcasting to ``object`` dtype (:issue:`60282`)
113114
- Bug in :meth:`Series.str.replace` when ``n < 0`` for :class:`StringDtype` with ``storage="pyarrow"`` (:issue:`59628`)
114115
- Bug in ``ser.str.slice`` with negative ``step`` with :class:`ArrowDtype` and :class:`StringDtype` with ``storage="pyarrow"`` giving incorrect results (:issue:`59710`)
115116
- Bug in the ``center`` method on :class:`Series` and :class:`Index` object ``str`` accessors with pyarrow-backed dtype not matching the python behavior in corner cases with an odd number of fill characters (:issue:`54792`)
116-
- Bug in :meth:`DataFrame.sum` with ``axis=1``, :meth:`.DataFrameGroupBy.sum` or :meth:`.SeriesGroupBy.sum` with ``skipna=True``, and :meth:`.Resampler.sum` on :class:`StringDtype` with all NA values resulted in ``0`` and is now the empty string ``""`` (:issue:`???`)
117117

118118
Interval
119119
^^^^^^^^

pandas/core/arrays/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2631,6 +2631,8 @@ def _groupby_op(
26312631

26322632
arr = self
26332633
if op.how == "sum":
2634+
# https://github.com/pandas-dev/pandas/issues/60229
2635+
# All NA should result in the empty string.
26342636
assert "skipna" in kwargs
26352637
if kwargs["skipna"] and min_count == 0:
26362638
arr = arr.fillna("")

pandas/tests/frame/test_reductions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ def test_axis_1_empty(self, all_reductions, index):
837837

838838
@pytest.mark.parametrize("min_count", [0, 1])
839839
def test_axis_1_sum_na(self, string_dtype_no_object, skipna, min_count):
840-
# GH#???
840+
# https://github.com/pandas-dev/pandas/issues/60229
841841
dtype = string_dtype_no_object
842842
df = DataFrame({"a": [pd.NA]}, dtype=dtype)
843843
result = df.sum(axis=1, skipna=skipna, min_count=min_count)

pandas/tests/groupby/test_reductions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def test_min_empty_string_dtype(func, string_dtype_no_object):
957957

958958
@pytest.mark.parametrize("min_count", [0, 1])
959959
def test_string_dtype_empty_sum(string_dtype_no_object, skipna, min_count):
960-
# GH#???
960+
# https://github.com/pandas-dev/pandas/issues/60229
961961
dtype = string_dtype_no_object
962962
df = DataFrame({"a": ["x"], "b": [pd.NA]}, dtype=dtype)
963963
gb = df.groupby("a")

pandas/tests/resample/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def test_resample_empty_series(freq, index, resample_method):
225225

226226
@pytest.mark.parametrize("min_count", [0, 1])
227227
def test_resample_empty_sum_string(string_dtype_no_object, min_count):
228-
# GH#???
228+
# https://github.com/pandas-dev/pandas/issues/60229
229229
dtype = string_dtype_no_object
230230
ser = Series(
231231
pd.NA,

pandas/tests/resample/test_resampler_grouper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def test_resample_groupby_agg_object_dtype_all_nan(consolidate):
498498
def test_groupby_resample_empty_sum_string(
499499
string_dtype_no_object, test_frame, min_count
500500
):
501-
# GH#???
501+
# https://github.com/pandas-dev/pandas/issues/60229
502502
dtype = string_dtype_no_object
503503
test_frame = test_frame.assign(B=pd.array([pd.NA] * len(test_frame), dtype=dtype))
504504
gbrs = test_frame.groupby("A").resample("40s")

0 commit comments

Comments
 (0)