Skip to content

SNOW-2173685 respect existing param control of using SCOPED keyword f… #2374

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sfc-gh-zyao
Copy link
Contributor

@sfc-gh-zyao sfc-gh-zyao commented Jun 24, 2025

…or sproc

Description

  • respect existing param control of using SCOPED keyword for sproc
    • currently whether to use scoped keyword for sproc is controlled by the parameter ENABLE_FIX_1375538, and this change makes sure we respect that
    • the change is effectively no-op for non-sproc because with or without SCOPED keyword, they will use session-scoped temp objects when writing pandas.
    • for Snowflake reviewers, more details about this decision is covered in this doc

Testing

  • existing tests to make sure this change does not break anything
  • manual testing to make sure this is working for sproc
    • when we enable ENABLE_FIX_1375538, we see a job-scoped temp object is created
      scoped enabled
    • when we disable ENABLE_FIX_1375538, we are not seeing job-scoped temp object. Instead, we see session-scoped temp, which remains valid even beyond sproc
      scoped disabled

Please answer these questions before submitting your pull requests. Thanks!

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

    Fixes #NNNN

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am adding a new telemetry message
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency
  3. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.

  4. (Optional) PR for stored-proc connector:

@sfc-gh-zyao sfc-gh-zyao requested a review from sfc-gh-sfan June 24, 2025 21:32
conn._session_parameters.get(
_PYTHON_SNOWPARK_USE_SCOPED_TEMP_OBJECTS_STRING, False
)
conn._session_parameters.get("ENABLE_FIX_1375538", False)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a note to remove this with a BCR from the server side to make these temp objects job scoped.

Also, let's use a more meaning variable name to represent ENABLE_FIX_1375538. We should verify if this param can be fetched outside of sp. I suspect not and this might just be a pure no-op outside of sp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants