-
Notifications
You must be signed in to change notification settings - Fork 110
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-878135 is_permanent behavior fix #989
Changes from 3 commits
d949b45
8f2a11f
5082600
ea9e513
5dd27fd
d979db2
9b889b3
d12ab33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -331,7 +331,7 @@ def check_register_args( | |
is_permanent: bool = False, | ||
stage_location: Optional[str] = None, | ||
parallel: int = 4, | ||
): | ||
) -> Optional[str]: | ||
if is_permanent: | ||
if not name: | ||
raise ValueError( | ||
|
@@ -341,12 +341,19 @@ def check_register_args( | |
raise ValueError( | ||
f"stage_location must be specified for permanent {get_error_message_abbr(object_type)}" | ||
) | ||
else: | ||
if stage_location: | ||
logger.warn( | ||
"is_permanent is False therefore stage_location will be ignored" | ||
) | ||
|
||
if parallel < 1 or parallel > 99: | ||
raise ValueError( | ||
"Supported values of parallel are from 1 to 99, " f"but got {parallel}" | ||
) | ||
|
||
return stage_location if is_permanent else None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think checking and warning about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. I think that is the right way to do things here. I'll reformat the code. |
||
|
||
|
||
def check_execute_as_arg(execute_as: typing.Literal["caller", "owner"]): | ||
if ( | ||
|
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 we also need to call out that the default behavior is changing because the default value of
is_permanent
isNone
. So the behavior of a UDF that only hasstage_name
specified will see their UDF becomes temporary.