Yikun commented on code in PR #36353:
URL: https://github.com/apache/spark/pull/36353#discussion_r881456319


##########
python/pyspark/pandas/frame.py:
##########
@@ -490,20 +491,30 @@ def _internal(self) -> InternalFrame:
         return cast(InternalFrame, self._internal_frame)  # type: 
ignore[has-type]
 
     def _update_internal_frame(
-        self, internal: InternalFrame, requires_same_anchor: bool = True
+        self,
+        internal: InternalFrame,
+        requires_same_anchor: bool = True,
+        force_disconnect: bool = False,
     ) -> None:
         """
         Update InternalFrame with the given one.
 
-        If the column_label is changed or the new InternalFrame is not the 
same `anchor`,
-        disconnect the link to the Series and create a new one.
+        If the column_label is changed or the new InternalFrame is not the 
same `anchor` or the
+        `force_disconnect` flag is set to True, disconnect the link to the 
Series and create a new
+        one.

Review Comment:
   This patch is more about adding some special processing to follow pandas 
behavior, `__setitems__` generate the new df after pandas 1.4, some API 
behaviors changes.
   
   So, if `force_disconnect` is `True` always return new df otherwise keep the 
original logic.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to