|
11 | 11 | cast,
|
12 | 12 | final,
|
13 | 13 | )
|
14 |
| -import warnings |
15 | 14 |
|
16 | 15 | import numpy as np
|
17 | 16 |
|
|
36 | 35 | )
|
37 | 36 | from pandas.errors import AbstractMethodError
|
38 | 37 | from pandas.util._decorators import cache_readonly
|
39 |
| -from pandas.util._exceptions import find_stack_level |
40 | 38 | from pandas.util._validators import validate_bool_kwarg
|
41 | 39 |
|
42 | 40 | from pandas.core.dtypes.astype import astype_array_safe
|
@@ -1545,35 +1543,6 @@ def putmask(self, mask, new) -> list[Block]:
|
1545 | 1543 |
|
1546 | 1544 | return [self]
|
1547 | 1545 |
|
1548 |
| - def fillna( |
1549 |
| - self, value, limit: int | None = None, inplace: bool = False, downcast=None |
1550 |
| - ) -> list[Block]: |
1551 |
| - # Caller is responsible for validating limit; if int it is strictly positive |
1552 |
| - |
1553 |
| - if self.dtype.kind == "m": |
1554 |
| - try: |
1555 |
| - res_values = self.values.fillna(value, limit=limit) |
1556 |
| - except (ValueError, TypeError): |
1557 |
| - # GH#45746 |
1558 |
| - warnings.warn( |
1559 |
| - "The behavior of fillna with timedelta64[ns] dtype and " |
1560 |
| - f"an incompatible value ({type(value)}) is deprecated. " |
1561 |
| - "In a future version, this will cast to a common dtype " |
1562 |
| - "(usually object) instead of raising, matching the " |
1563 |
| - "behavior of other dtypes.", |
1564 |
| - FutureWarning, |
1565 |
| - stacklevel=find_stack_level(), |
1566 |
| - ) |
1567 |
| - raise |
1568 |
| - else: |
1569 |
| - res_blk = self.make_block(res_values) |
1570 |
| - return [res_blk] |
1571 |
| - |
1572 |
| - # TODO: since this now dispatches to super, which in turn dispatches |
1573 |
| - # to putmask, it may *actually* respect 'inplace=True'. If so, add |
1574 |
| - # tests for this. |
1575 |
| - return super().fillna(value, limit=limit, inplace=inplace, downcast=downcast) |
1576 |
| - |
1577 | 1546 | def delete(self, loc) -> Block:
|
1578 | 1547 | # This will be unnecessary if/when __array_function__ is implemented
|
1579 | 1548 | values = self.values.delete(loc)
|
|
0 commit comments