diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 5f69b3deeab4e..a18db1867e0c1 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -4211,7 +4211,7 @@ def __setitem__(self, key, value) -> None: warn_copy_on_write() or ( not warn_copy_on_write() - and any(b.refs.has_reference() for b in self._mgr.blocks) + and any(b.refs.has_reference() for b in self._mgr.blocks) # type: ignore[union-attr] ) ): warnings.warn(