HyukjinKwon commented on a change in pull request #35150:
URL: https://github.com/apache/spark/pull/35150#discussion_r781783259



##########
File path: python/pyspark/pandas/groupby.py
##########
@@ -2356,12 +2356,16 @@ def nunique(self, dropna: bool = True) -> FrameLike:
         Name: value1, dtype: int64
         """
         if dropna:
-            stat_function = lambda col: F.countDistinct(col)
+
+            def stat_function(col: Column) -> Column:

Review comment:
       let me just keep it as an explicit function def .. otherwise it 
complains about argument type `[Union[Column, str]]` that's not matched with 
`stat_function` below. I tried few other ways but seems like this is most 
straightforward.




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