You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2023/09/11 04:46:17 UTC

[GitHub] [spark] zhengruifeng commented on a diff in pull request #42788: [SPARK-43291][PS] Generate proper warning on different behavior with `numeric_only`

zhengruifeng commented on code in PR #42788:
URL: https://github.com/apache/spark/pull/42788#discussion_r1320988487


##########
python/pyspark/pandas/frame.py:
##########
@@ -9029,6 +9047,14 @@ def cov(self, min_periods: Optional[int] = None, ddof: int = 1) -> "DataFrame":
         """
         if not isinstance(ddof, int):
             raise TypeError("ddof must be integer")
+        if numeric_only is None:

Review Comment:
   do we need to warn users if all columns are numeric?



##########
python/pyspark/pandas/groupby.py:
##########
@@ -608,18 +608,18 @@ def max(self, numeric_only: Optional[bool] = False, min_count: int = -1) -> Fram
             min_count=min_count,
         )
 
-    def mean(self, numeric_only: Optional[bool] = True) -> FrameLike:
+    def mean(self, numeric_only: Optional[bool] = None) -> FrameLike:
         """
         Compute mean of groups, excluding missing values.
 
         Parameters
         ----------
-        numeric_only : bool, default True
+        numeric_only : bool, default None
             Include only float, int, boolean columns. If None, will attempt to use
             everything, then use only numeric data. False is not supported.
             This parameter is mainly for pandas compatibility.
 
-            .. versionadded:: 3.4.0
+            .. versionchanged:: 4.0.0

Review Comment:
   shall we keep the old `versionchanged` and add this new one?
   both `versionchanged` should doc what was changed.



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