diff --git a/doc/source/whatsnew/v1.1.0.rst b/doc/source/whatsnew/v1.1.0.rst index 21e59805fa143..fb45a9390e1d8 100644 --- a/doc/source/whatsnew/v1.1.0.rst +++ b/doc/source/whatsnew/v1.1.0.rst @@ -303,8 +303,8 @@ Indexing Missing ^^^^^^^ -- -- +- Calling :meth:`fillna` on an empty Series now correctly returns a shallow copied object. The behaviour is now consistent with :class:`Index`, :class:`DataFrame` and a non-empty :class:`Series` (:issue:`32543`). + MultiIndex ^^^^^^^^^^ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 8d56311331d4d..88c2ea810b3b6 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6081,9 +6081,6 @@ def fillna( downcast=downcast, ) else: - if len(self._get_axis(axis)) == 0: - return self - if self.ndim == 1: if isinstance(value, (dict, ABCSeries)): value = create_series_with_explicit_dtype( diff --git a/pandas/tests/base/test_ops.py b/pandas/tests/base/test_ops.py index 5a78e5d6352a9..9f94a74fbb581 100644 --- a/pandas/tests/base/test_ops.py +++ b/pandas/tests/base/test_ops.py @@ -611,9 +611,6 @@ def test_fillna(self, index_or_series_obj): tm.assert_series_equal(obj, result) # check shallow_copied - if isinstance(obj, Series) and len(obj) == 0: - # TODO: GH-32543 - pytest.xfail("Shallow copy for empty Series is bugged") assert obj is not result @pytest.mark.parametrize("null_obj", [np.nan, None])