|
82 | 82 | WriteExcelBuffer, |
83 | 83 | npt, |
84 | 84 | ) |
| 85 | +from pandas.compat import PYPY |
85 | 86 | from pandas.compat._constants import ( |
86 | | - CHAINED_WARNING_DISABLED_INPLACE_METHOD, |
87 | 87 | REF_COUNT, |
| 88 | + WARNING_CHECK_DISABLED, |
88 | 89 | ) |
89 | 90 | from pandas.compat._optional import import_optional_dependency |
90 | 91 | from pandas.compat.numpy import function as nv |
@@ -2074,6 +2075,7 @@ def __getstate__(self) -> dict[str, Any]: |
2074 | 2075 | **meta, |
2075 | 2076 | } |
2076 | 2077 |
|
| 2078 | + @final |
2077 | 2079 | def __setstate__(self, state) -> None: |
2078 | 2080 | if isinstance(state, BlockManager): |
2079 | 2081 | self._mgr = state |
@@ -4264,9 +4266,8 @@ def _slice(self, slobj: slice, axis: AxisInt = 0) -> Self: |
4264 | 4266 | result = result.__finalize__(self) |
4265 | 4267 | return result |
4266 | 4268 |
|
4267 | | - # def __delitem__() is implemented in SetitemMixin and dispatches to this method |
4268 | 4269 | @final |
4269 | | - def _delitem(self, key) -> None: |
| 4270 | + def __delitem__(self, key) -> None: |
4270 | 4271 | """ |
4271 | 4272 | Delete item |
4272 | 4273 | """ |
@@ -7081,7 +7082,7 @@ def fillna( |
7081 | 7082 | """ |
7082 | 7083 | inplace = validate_bool_kwarg(inplace, "inplace") |
7083 | 7084 | if inplace: |
7084 | | - if not CHAINED_WARNING_DISABLED_INPLACE_METHOD: |
| 7085 | + if not PYPY and not WARNING_CHECK_DISABLED: |
7085 | 7086 | if sys.getrefcount(self) <= REF_COUNT: |
7086 | 7087 | warnings.warn( |
7087 | 7088 | _chained_assignment_method_msg, |
@@ -7328,7 +7329,7 @@ def ffill( |
7328 | 7329 | """ |
7329 | 7330 | inplace = validate_bool_kwarg(inplace, "inplace") |
7330 | 7331 | if inplace: |
7331 | | - if not CHAINED_WARNING_DISABLED_INPLACE_METHOD: |
| 7332 | + if not PYPY and not WARNING_CHECK_DISABLED: |
7332 | 7333 | if sys.getrefcount(self) <= REF_COUNT: |
7333 | 7334 | warnings.warn( |
7334 | 7335 | _chained_assignment_method_msg, |
@@ -7468,7 +7469,7 @@ def bfill( |
7468 | 7469 | """ |
7469 | 7470 | inplace = validate_bool_kwarg(inplace, "inplace") |
7470 | 7471 | if inplace: |
7471 | | - if not CHAINED_WARNING_DISABLED_INPLACE_METHOD: |
| 7472 | + if not PYPY and not WARNING_CHECK_DISABLED: |
7472 | 7473 | if sys.getrefcount(self) <= REF_COUNT: |
7473 | 7474 | warnings.warn( |
7474 | 7475 | _chained_assignment_method_msg, |
@@ -7553,7 +7554,7 @@ def replace( |
7553 | 7554 |
|
7554 | 7555 | inplace = validate_bool_kwarg(inplace, "inplace") |
7555 | 7556 | if inplace: |
7556 | | - if not CHAINED_WARNING_DISABLED_INPLACE_METHOD: |
| 7557 | + if not PYPY and not WARNING_CHECK_DISABLED: |
7557 | 7558 | if sys.getrefcount(self) <= REF_COUNT: |
7558 | 7559 | warnings.warn( |
7559 | 7560 | _chained_assignment_method_msg, |
@@ -7916,7 +7917,7 @@ def interpolate( |
7916 | 7917 | inplace = validate_bool_kwarg(inplace, "inplace") |
7917 | 7918 |
|
7918 | 7919 | if inplace: |
7919 | | - if not CHAINED_WARNING_DISABLED_INPLACE_METHOD: |
| 7920 | + if not PYPY and not WARNING_CHECK_DISABLED: |
7920 | 7921 | if sys.getrefcount(self) <= REF_COUNT: |
7921 | 7922 | warnings.warn( |
7922 | 7923 | _chained_assignment_method_msg, |
@@ -8571,7 +8572,7 @@ def clip( |
8571 | 8572 | inplace = validate_bool_kwarg(inplace, "inplace") |
8572 | 8573 |
|
8573 | 8574 | if inplace: |
8574 | | - if not CHAINED_WARNING_DISABLED_INPLACE_METHOD: |
| 8575 | + if not PYPY and not WARNING_CHECK_DISABLED: |
8575 | 8576 | if sys.getrefcount(self) <= REF_COUNT: |
8576 | 8577 | warnings.warn( |
8577 | 8578 | _chained_assignment_method_msg, |
@@ -10206,7 +10207,7 @@ def where( |
10206 | 10207 | """ |
10207 | 10208 | inplace = validate_bool_kwarg(inplace, "inplace") |
10208 | 10209 | if inplace: |
10209 | | - if not CHAINED_WARNING_DISABLED_INPLACE_METHOD: |
| 10210 | + if not PYPY and not WARNING_CHECK_DISABLED: |
10210 | 10211 | if sys.getrefcount(self) <= REF_COUNT: |
10211 | 10212 | warnings.warn( |
10212 | 10213 | _chained_assignment_method_msg, |
@@ -10270,7 +10271,7 @@ def mask( |
10270 | 10271 | ) -> Self | None: |
10271 | 10272 | inplace = validate_bool_kwarg(inplace, "inplace") |
10272 | 10273 | if inplace: |
10273 | | - if not CHAINED_WARNING_DISABLED_INPLACE_METHOD: |
| 10274 | + if not PYPY and not WARNING_CHECK_DISABLED: |
10274 | 10275 | if sys.getrefcount(self) <= REF_COUNT: |
10275 | 10276 | warnings.warn( |
10276 | 10277 | _chained_assignment_method_msg, |
|
0 commit comments