Skip to content
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

Unify Snowflake object name handling in the Snowpark AST #2789

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

sfc-gh-oplaton
Copy link
Contributor

@sfc-gh-oplaton sfc-gh-oplaton commented Dec 19, 2024

  1. Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Fixes SNOW-1621205

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
      • If this test skips Local Testing mode, I'm requesting review from @snowflakedb/local-testing
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am adding new credentials
    • I am adding a new dependency
    • If this is a new feature/behavior, I'm adding the Local Testing parity changes.
    • I acknowledge that I have ensured my changes to be thread-safe. Follow the link for more information: Thread-safe Developer Guidelines
  3. 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 FnName and SpTableName. They both had Flat and Structured variants, but ultimately designate Snowflake object names.
Introduce data SpName and entity SpNameRef for referring to Snowflake objects by relative or fully qualified name.
Update FnNameRefExpr.
Use SpNameRef in a few places that used to use List[String].

@sfc-gh-oplaton sfc-gh-oplaton added NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs labels Dec 19, 2024
@sfc-gh-oplaton sfc-gh-oplaton marked this pull request as ready for review December 21, 2024 01:18
@sfc-gh-oplaton sfc-gh-oplaton requested review from a team as code owners December 21, 2024 01:18
@sfc-gh-oplaton sfc-gh-oplaton enabled auto-merge (squash) December 21, 2024 01:18
@sfc-gh-oplaton sfc-gh-oplaton changed the title Introduce a uniform ObjectName trait for referring to Snowflake objects Unify Snowflake object name handling in the Snowpark AST Dec 21, 2024
@@ -239,49 +206,39 @@ body {
fn {
builtin_fn {
name {
fn_name_flat {
name: "col"
name {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it's nested twice -- is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the outer name is of type SpNameRef and comes from the trait FnNameRefExpr, and the inner name is the field of the SpNameRef, of type SpName.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NO-CHANGELOG-UPDATES This pull request does not need to update CHANGELOG.md NO-PANDAS-CHANGEDOC-UPDATES This PR does not update Snowpark pandas docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants