9090 npt ,
9191)
9292from pandas .compat import PYPY
93- from pandas .compat ._constants import REF_COUNT
93+ from pandas .compat ._constants import (
94+ REF_COUNT ,
95+ WARNING_CHECK_DISABLED ,
96+ )
9497from pandas .compat ._optional import import_optional_dependency
9598from pandas .compat .numpy import function as nv
9699from pandas .errors import (
@@ -7285,7 +7288,7 @@ def fillna(
72857288 """
72867289 inplace = validate_bool_kwarg (inplace , "inplace" )
72877290 if inplace :
7288- if not PYPY and using_copy_on_write ():
7291+ if not PYPY and not WARNING_CHECK_DISABLED and using_copy_on_write ():
72897292 if sys .getrefcount (self ) <= REF_COUNT :
72907293 warnings .warn (
72917294 _chained_assignment_method_msg ,
@@ -7294,6 +7297,7 @@ def fillna(
72947297 )
72957298 elif (
72967299 not PYPY
7300+ and not WARNING_CHECK_DISABLED
72977301 and not using_copy_on_write ()
72987302 and self ._is_view_after_cow_rules ()
72997303 ):
@@ -7588,7 +7592,7 @@ def ffill(
75887592 downcast = self ._deprecate_downcast (downcast , "ffill" )
75897593 inplace = validate_bool_kwarg (inplace , "inplace" )
75907594 if inplace :
7591- if not PYPY and using_copy_on_write ():
7595+ if not PYPY and not WARNING_CHECK_DISABLED and using_copy_on_write ():
75927596 if sys .getrefcount (self ) <= REF_COUNT :
75937597 warnings .warn (
75947598 _chained_assignment_method_msg ,
@@ -7597,6 +7601,7 @@ def ffill(
75977601 )
75987602 elif (
75997603 not PYPY
7604+ and not WARNING_CHECK_DISABLED
76007605 and not using_copy_on_write ()
76017606 and self ._is_view_after_cow_rules ()
76027607 ):
@@ -7792,7 +7797,7 @@ def bfill(
77927797 downcast = self ._deprecate_downcast (downcast , "bfill" )
77937798 inplace = validate_bool_kwarg (inplace , "inplace" )
77947799 if inplace :
7795- if not PYPY and using_copy_on_write ():
7800+ if not PYPY and not WARNING_CHECK_DISABLED and using_copy_on_write ():
77967801 if sys .getrefcount (self ) <= REF_COUNT :
77977802 warnings .warn (
77987803 _chained_assignment_method_msg ,
@@ -7801,6 +7806,7 @@ def bfill(
78017806 )
78027807 elif (
78037808 not PYPY
7809+ and not WARNING_CHECK_DISABLED
78047810 and not using_copy_on_write ()
78057811 and self ._is_view_after_cow_rules ()
78067812 ):
@@ -7963,7 +7969,7 @@ def replace(
79637969
79647970 inplace = validate_bool_kwarg (inplace , "inplace" )
79657971 if inplace :
7966- if not PYPY and using_copy_on_write ():
7972+ if not PYPY and not WARNING_CHECK_DISABLED and using_copy_on_write ():
79677973 if sys .getrefcount (self ) <= REF_COUNT :
79687974 warnings .warn (
79697975 _chained_assignment_method_msg ,
@@ -7972,6 +7978,7 @@ def replace(
79727978 )
79737979 elif (
79747980 not PYPY
7981+ and not WARNING_CHECK_DISABLED
79757982 and not using_copy_on_write ()
79767983 and self ._is_view_after_cow_rules ()
79777984 ):
@@ -8415,7 +8422,7 @@ def interpolate(
84158422 inplace = validate_bool_kwarg (inplace , "inplace" )
84168423
84178424 if inplace :
8418- if not PYPY and using_copy_on_write ():
8425+ if not PYPY and not WARNING_CHECK_DISABLED and using_copy_on_write ():
84198426 if sys .getrefcount (self ) <= REF_COUNT :
84208427 warnings .warn (
84218428 _chained_assignment_method_msg ,
@@ -8424,6 +8431,7 @@ def interpolate(
84248431 )
84258432 elif (
84268433 not PYPY
8434+ and not WARNING_CHECK_DISABLED
84278435 and not using_copy_on_write ()
84288436 and self ._is_view_after_cow_rules ()
84298437 ):
@@ -9057,7 +9065,7 @@ def clip(
90579065 inplace = validate_bool_kwarg (inplace , "inplace" )
90589066
90599067 if inplace :
9060- if not PYPY and using_copy_on_write ():
9068+ if not PYPY and not WARNING_CHECK_DISABLED and using_copy_on_write ():
90619069 if sys .getrefcount (self ) <= REF_COUNT :
90629070 warnings .warn (
90639071 _chained_assignment_method_msg ,
@@ -9066,6 +9074,7 @@ def clip(
90669074 )
90679075 elif (
90689076 not PYPY
9077+ and not WARNING_CHECK_DISABLED
90699078 and not using_copy_on_write ()
90709079 and self ._is_view_after_cow_rules ()
90719080 ):
@@ -10975,7 +10984,7 @@ def where(
1097510984 """
1097610985 inplace = validate_bool_kwarg (inplace , "inplace" )
1097710986 if inplace :
10978- if not PYPY and using_copy_on_write ():
10987+ if not PYPY and not WARNING_CHECK_DISABLED and using_copy_on_write ():
1097910988 if sys .getrefcount (self ) <= REF_COUNT :
1098010989 warnings .warn (
1098110990 _chained_assignment_method_msg ,
@@ -10984,6 +10993,7 @@ def where(
1098410993 )
1098510994 elif (
1098610995 not PYPY
10996+ and not WARNING_CHECK_DISABLED
1098710997 and not using_copy_on_write ()
1098810998 and self ._is_view_after_cow_rules ()
1098910999 ):
@@ -11058,7 +11068,7 @@ def mask(
1105811068 ) -> Self | None :
1105911069 inplace = validate_bool_kwarg (inplace , "inplace" )
1106011070 if inplace :
11061- if not PYPY and using_copy_on_write ():
11071+ if not PYPY and not WARNING_CHECK_DISABLED and using_copy_on_write ():
1106211072 if sys .getrefcount (self ) <= REF_COUNT :
1106311073 warnings .warn (
1106411074 _chained_assignment_method_msg ,
@@ -11067,6 +11077,7 @@ def mask(
1106711077 )
1106811078 elif (
1106911079 not PYPY
11080+ and not WARNING_CHECK_DISABLED
1107011081 and not using_copy_on_write ()
1107111082 and self ._is_view_after_cow_rules ()
1107211083 ):
0 commit comments