-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SNOW-1429199]: Provide clearer error message for groupby aggregations #2308
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, left one nit
ValueError, match=re.escape('For argument "numeric_only" expected type bool') | ||
ValueError, | ||
match=re.escape( | ||
"GroupBy aggregations like 'sum' take a 'numeric_only' argument that needs to be a bool, but a str value was passed in." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to parametrize by "numeric_only,type_name"
since int and string have different names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch - but instead of adding extra parameter, I just updated the error message to be an f-string and use {type(numeric_only).name}, same as where the error message is thrown.
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1429199
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Ensure clearer error messages for groupby aggregations to help snowpark users.