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


##########
python/pyspark/pandas/groupby.py:
##########
@@ -2673,7 +2682,7 @@ def get_group(self, name: Union[Name, List[Name]]) -> 
FrameLike:
 
         return self._cleanup_and_return(DataFrame(internal))
 
-    def median(self, numeric_only: bool = True, accuracy: int = 10000) -> 
FrameLike:
+    def median(self, numeric_only: Optional[bool] = True, accuracy: int = 
10000) -> FrameLike:

Review Comment:
   Looks like it is right.
   
   But the different is Pandas are using [`None` as default 
value](https://github.com/pandas-dev/pandas/blob/4bfe3d07b4858144c219b9346329027024102ab6/pandas/core/groupby/groupby.py#L1966),
 and use 
[_resolve_numeric_only](https://github.com/pandas-dev/pandas/blob/4bfe3d07b4858144c219b9346329027024102ab6/pandas/core/groupby/groupby.py#L1207)
 as a resolve to set default value (`true` or `false`).
   
   @xinrong-databricks kept behaviors according pandas doc, could you also take 
a look, should we also add some logic like this?



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