@@ -7462,6 +7462,18 @@ def ffill(
7462
7462
ChainedAssignmentError ,
7463
7463
stacklevel = 2 ,
7464
7464
)
7465
+ elif not PYPY and not using_copy_on_write ():
7466
+ ctr = sys .getrefcount (self )
7467
+ ref_count = REF_COUNT
7468
+ if isinstance (self , ABCSeries ) and hasattr (self , "_cacher" ):
7469
+ # see https://github.com/pandas-dev/pandas/pull/56060#discussion_r1399245221
7470
+ ref_count += 1
7471
+ if ctr <= ref_count :
7472
+ warnings .warn (
7473
+ _chained_assignment_warning_method_msg ,
7474
+ FutureWarning ,
7475
+ stacklevel = 2 ,
7476
+ )
7465
7477
7466
7478
return self ._pad_or_backfill (
7467
7479
"ffill" ,
@@ -7633,6 +7645,19 @@ def bfill(
7633
7645
ChainedAssignmentError ,
7634
7646
stacklevel = 2 ,
7635
7647
)
7648
+ elif not PYPY and not using_copy_on_write ():
7649
+ ctr = sys .getrefcount (self )
7650
+ ref_count = REF_COUNT
7651
+ if isinstance (self , ABCSeries ) and hasattr (self , "_cacher" ):
7652
+ # see https://github.com/pandas-dev/pandas/pull/56060#discussion_r1399245221
7653
+ ref_count += 1
7654
+ if ctr <= ref_count :
7655
+ warnings .warn (
7656
+ _chained_assignment_warning_method_msg ,
7657
+ FutureWarning ,
7658
+ stacklevel = 2 ,
7659
+ )
7660
+
7636
7661
return self ._pad_or_backfill (
7637
7662
"bfill" ,
7638
7663
axis = axis ,
@@ -8227,6 +8252,18 @@ def interpolate(
8227
8252
ChainedAssignmentError ,
8228
8253
stacklevel = 2 ,
8229
8254
)
8255
+ elif not PYPY and not using_copy_on_write ():
8256
+ ctr = sys .getrefcount (self )
8257
+ ref_count = REF_COUNT
8258
+ if isinstance (self , ABCSeries ) and hasattr (self , "_cacher" ):
8259
+ # see https://github.com/pandas-dev/pandas/pull/56060#discussion_r1399245221
8260
+ ref_count += 1
8261
+ if ctr <= ref_count :
8262
+ warnings .warn (
8263
+ _chained_assignment_warning_method_msg ,
8264
+ FutureWarning ,
8265
+ stacklevel = 2 ,
8266
+ )
8230
8267
8231
8268
axis = self ._get_axis_number (axis )
8232
8269
0 commit comments