You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/27 00:23:03 UTC

[GitHub] [spark] xinrong-databricks commented on a diff in pull request #36353: [SPARK-38946][PYTHON][PS] Generates a new dataframe instead of operating inplace in df.eval/update/fillna/setitem

xinrong-databricks commented on code in PR #36353:
URL: https://github.com/apache/spark/pull/36353#discussion_r883180986


##########
python/pyspark/pandas/frame.py:
##########
@@ -5495,7 +5506,15 @@ def op(psser: ps.Series) -> ps.Series:
 
         inplace = validate_bool_kwarg(inplace, "inplace")
         if inplace:
-            self._update_internal_frame(psdf._internal, requires_same_anchor=False)
+            # Since Pandas 1.4, df.fillna generates a new dataframe instead of operating
+            # in-place. See also SPARK-38946. Currently, `bfill` and `ffill` still keep
+            # inplace operate behaviors.
+            force_disconnect = (method is None) and LooseVersion(pd.__version__) >= LooseVersion(

Review Comment:
   Spark 3.4 is claimed to match pandas 1.4, do we need this version check?



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org