gaogaotiantian commented on code in PR #54162:
URL: https://github.com/apache/spark/pull/54162#discussion_r2771826881
##########
python/pyspark/pandas/groupby.py:
##########
@@ -492,6 +493,7 @@ def first(self, numeric_only: Optional[bool] = False,
min_count: int = -1) -> Fr
a 1.0 True 3.0
b NaN None NaN
"""
+ validate_numeric_only(numeric_only)
Review Comment:
Oh pandas 3 raises `ValueError`, interesting. That feels a bit off to me but
yes we should follow them.
The thing I'm concerned about is the final code. We would have a utility
function validate_numeric_only which only check if it's `bool`. That seems a
bit weird to me. That's not how the existing code works. We have a lot of
"shared parameters" between different methods, but we normally don't do a
utility function to validate them unless the logic is rather complicated.
--
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]