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


##########
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:
   I think `keeping version checks in unit tests` is better, and also a better 
principle for similar cases:
   - Don't use version check in code/implementation as far as possible, UT is a 
better place to do it, according UT we can easy to see what the behavior change.
   - All test should be passed with any version of pandas > 1.0.5.



-- 
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