Unify Snowflake object name handling in the Snowpark AST#2789
Merged
sfc-gh-oplaton merged 16 commits intomainfrom Jan 6, 2025
Merged
Unify Snowflake object name handling in the Snowpark AST#2789sfc-gh-oplaton merged 16 commits intomainfrom
sfc-gh-oplaton merged 16 commits intomainfrom
Conversation
The serialized batch was getting large enough to exceed command-line length limits
sfc-gh-azwiegincew
approved these changes
Jan 3, 2025
| expr_builder.sp_table_name_structured.name.extend(name) | ||
| else: | ||
| raise ValueError(f"Invalid name type {type(name)} for SpTableName entity.") | ||
| def build_sp_table_name( |
Collaborator
There was a problem hiding this comment.
Are these type-specific functions necessary? One thing I notice is that the re-emitted exceptions lose the diagnostic contents of the original exception.
Contributor
Author
There was a problem hiding this comment.
One thing I notice is that the re-emitted exceptions lose the diagnostic contents of the original exception.
That's weird, raise ... from ... should preserve the contents. The functions aren't strictly necessary, but I find the call sites more readable (the name clarifies the intent), and the errors should have been more readable, too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1621205
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
This is the client-side change corresponding to https://github.com/snowflakedb/snowflake/pull/240557
Unify Snowflake object name handling in the Snowpark AST.
Remove
FnNameandSpTableName. They both hadFlatandStructuredvariants, but ultimately designate Snowflake object names.Introduce
data SpNameandentity SpNameReffor referring to Snowflake objects by relative or fully qualified name.Update
FnNameRefExpr.Use
SpNameRefin a few places that used to useList[String].