-
Notifications
You must be signed in to change notification settings - Fork 119
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
accept stage paths starting with / for GET #2889
accept stage paths starting with / for GET #2889
Conversation
All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
@sfc-gh-tvanderkooy can you fix the failing tests please. change looks good |
9ba13cf
to
59a7d69
Compare
Turns out the test failures were because my change breaks #2470, which adds an explicit error for using a non-stage path with I think it's unlikely for native app providers to want to use this in their app -- any file that is valid for these functions they could simply share as a table instead of putting as a file in the version stage -- so I opted to NOT support the relative stage path syntax for this case and preserve the existing error message. |
prefixes = ["file://"] if is_local else SNOWFLAKE_PATH_PREFIXES | ||
prefixes = ["file://"] if is_local else SNOWFLAKE_PATH_PREFIXES_FOR_GET |
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.
this change adds support when run inside a native apps environment. How does it affect when run outside NA? If it is not supported, then we should only allow the new prefix in NA env.
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.
Outside native apps this will be a SQL error. SQL compilation error: invalid URL prefix found in: '/some/path'
But that's the current behaviour too (for GET) - today if you do session.file.get('/some/path')
, snowpark will prepend @
and run the GET, and then throw SQL compilation error: missing stage name in URL: @/some/path
Unfortunately I'm not aware of a good way to check if this is NA env, it might be difficult to check that here.
3fb1be2
to
d5d5757
Compare
…t paths starting with `/` are an error.
d5d5757
to
96de4a1
Compare
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1793953 (SNOW-1889627: SNOW-1793953: Allow relative path starting with / for GET #2888)
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This builds on the changes from Add support for
snow://
stage paths #1346 to allow/
as a remote path prefix sofile.get('/some/path')
will not try to prepend@
to the path. This form of relative path is valid in some native application uses cases.