Skip to content

Commit

Permalink
ExtensionArray.fillna: start with DeprecationWarning about added copy…
Browse files Browse the repository at this point in the history
… keyword (#54800)
  • Loading branch information
jorisvandenbossche authored Aug 28, 2023
1 parent b043fcb commit 634096f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ def fillna(
"need to implement this keyword or an exception will be "
"raised. In the interim, the keyword is ignored by "
f"{type(self.values).__name__}.",
FutureWarning,
DeprecationWarning,
stacklevel=find_stack_level(),
)

Expand Down
8 changes: 4 additions & 4 deletions pandas/tests/extension/decimal/test_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_arith_series_with_array(self, data, all_arithmetic_operators):
def test_fillna_frame(self, data_missing):
msg = "ExtensionArray.fillna added a 'copy' keyword"
with tm.assert_produces_warning(
FutureWarning, match=msg, check_stacklevel=False
DeprecationWarning, match=msg, check_stacklevel=False
):
super().test_fillna_frame(data_missing)

Expand Down Expand Up @@ -166,7 +166,7 @@ def test_fillna_no_op_returns_copy(self, data):
def test_fillna_series(self, data_missing):
msg = "ExtensionArray.fillna added a 'copy' keyword"
with tm.assert_produces_warning(
FutureWarning, match=msg, check_stacklevel=False
DeprecationWarning, match=msg, check_stacklevel=False
):
super().test_fillna_series(data_missing)

Expand All @@ -178,13 +178,13 @@ def test_fillna_series_method(self, data_missing, fillna_method):
super().test_fillna_series_method(data_missing, fillna_method)

def test_fillna_copy_frame(self, data_missing, using_copy_on_write):
warn = FutureWarning if not using_copy_on_write else None
warn = DeprecationWarning if not using_copy_on_write else None
msg = "ExtensionArray.fillna added a 'copy' keyword"
with tm.assert_produces_warning(warn, match=msg, check_stacklevel=False):
super().test_fillna_copy_frame(data_missing)

def test_fillna_copy_series(self, data_missing, using_copy_on_write):
warn = FutureWarning if not using_copy_on_write else None
warn = DeprecationWarning if not using_copy_on_write else None
msg = "ExtensionArray.fillna added a 'copy' keyword"
with tm.assert_produces_warning(warn, match=msg, check_stacklevel=False):
super().test_fillna_copy_series(data_missing)
Expand Down

0 comments on commit 634096f

Please sign in to comment.