HyukjinKwon commented on code in PR #36414:
URL: https://github.com/apache/spark/pull/36414#discussion_r863330808


##########
python/pyspark/pandas/series.py:
##########
@@ -6859,13 +6860,16 @@ def _reduce_for_stat_function(
         sfun : the stats function to be used for aggregation
         name : original pandas API name.
         axis : used only for sanity check because series only support index 
axis.
-        numeric_only : not used by this implementation, but passed down by 
stats functions
+        numeric_only : not used by this implementation, but passed down by 
stats functions.
         """
         axis = validate_axis(axis)
         if axis == 1:
             raise NotImplementedError("Series does not support columns axis.")
 
-        scol = sfun(self)
+        if skipna:
+            scol = sfun(self)
+        else:
+            scol = F.first(F.lit(np.nan))

Review Comment:
   Hm,  shouldn't we apply the given function `sfun`?



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