-
Notifications
You must be signed in to change notification settings - Fork 112
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-1331032 add retrieve func defaults from source #1957
SNOW-1331032 add retrieve func defaults from source #1957
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.
Seems like a few lines are not covered by the test, can you add them?
I added more tests. Just a note that the full PR has coverage satisfied: #1509 |
class {class_name}: | ||
def {func_name}(self, x, y {datatype_str} = {annotated_value}) -> None: | ||
return None | ||
""" | ||
else: | ||
source = f""" | ||
def {func_name}(x, y {datatype_str} = {annotated_value}) -> None: | ||
return None |
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.
nit: have you tested multiple default values? def func(a, b=xx, c=xxx, g=xx)
it doesn't need to be complicated, but just testing multiple kwargs also works.
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 have it as an integration test over here: https://github.com/snowflakedb/snowpark-python/pull/1509/files#r1696077946
Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing |
Seems like your changes contain some Local Testing changes, please request review from @snowflakedb/local-testing |
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1331032
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Splits original PR SNOW-1331032: Support default argument values in UDXF and SP #1509.
This PR adds a new function
retrieve_func_defaults_from_source
which extracts default values from function registration when registrining sproc, udf, udtf from a file. The function is similar toretrieve_func_defaults_from_source
and parses the AST of the given file to extract the default values.