Skip to content

Commit e139c2a

Browse files
[pandas-dev#32543] obj.fillna(fill_value) doesn't shallow copy if obj is an empty Series
1 parent e5cd7b1 commit e139c2a

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

pandas/core/generic.py

-3
Original file line numberDiff line numberDiff line change
@@ -6081,9 +6081,6 @@ def fillna(
60816081
downcast=downcast,
60826082
)
60836083
else:
6084-
if len(self._get_axis(axis)) == 0:
6085-
return self
6086-
60876084
if self.ndim == 1:
60886085
if isinstance(value, (dict, ABCSeries)):
60896086
value = create_series_with_explicit_dtype(

pandas/tests/base/test_ops.py

-3
Original file line numberDiff line numberDiff line change
@@ -611,9 +611,6 @@ def test_fillna(self, index_or_series_obj):
611611
tm.assert_series_equal(obj, result)
612612

613613
# check shallow_copied
614-
if isinstance(obj, Series) and len(obj) == 0:
615-
# TODO: GH-32543
616-
pytest.xfail("Shallow copy for empty Series is bugged")
617614
assert obj is not result
618615

619616
@pytest.mark.parametrize("null_obj", [np.nan, None])

0 commit comments

Comments
 (0)