File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ from numpy cimport (
2323cnp.import_array()
2424
2525from pandas._libs.algos import ensure_int64
26+ from pandas.compat import PYPY
2627from pandas.errors import ChainedAssignmentError
2728from pandas.errors.cow import _chained_assignment_msg
2829
29-
3030from pandas._libs.util cimport (
3131 is_array,
3232 is_integer_object,
@@ -1031,11 +1031,13 @@ cdef class SetitemMixin:
10311031 # class used in DataFrame and Series for checking for chained assignment
10321032
10331033 def __setitem__ (self , key , value ) -> None:
1034- cdef bint is_unique = _is_unique_referenced_temporary(self )
1035- if is_unique:
1036- warnings.warn(
1037- _chained_assignment_msg , ChainedAssignmentError , stacklevel = 1
1038- )
1034+ cdef bint is_unique = 0
1035+ if not PYPY:
1036+ _is_unique_referenced_temporary(self )
1037+ if is_unique:
1038+ warnings.warn(
1039+ _chained_assignment_msg , ChainedAssignmentError , stacklevel = 1
1040+ )
10391041 self._setitem(key , value )
10401042
10411043 def __delitem__(self , key ) -> None:
You can’t perform that action at this time.
0 commit comments