Skip to content

Add support for connecting to snowpark container services#103

Open
punitchauhan771 wants to merge 7 commits intoSnowflake-Labs:masterfrom
punitchauhan771:django51
Open

Add support for connecting to snowpark container services#103
punitchauhan771 wants to merge 7 commits intoSnowflake-Labs:masterfrom
punitchauhan771:django51

Conversation

@punitchauhan771
Copy link
Copy Markdown

@punitchauhan771 punitchauhan771 commented Sep 9, 2024

added logic to connect to snowflake database inside snowpark container service,
the logic contains a new flag:

  • is_spcs_connection : boolean -> which the user can provide whether they want to connect to their snowflake db inside spcs or not

fixes #100

@timgraham timgraham changed the title Django51 Add support for connecting to snowpark container services Dec 23, 2024
added a new option flag indicating whether this needs an spcs ingress connection or not
@timgraham
Copy link
Copy Markdown
Collaborator

Is there a way we could implement this without adding is_spcs_connection to OPTIONS? Currently everything in OPTIONS is passed to snowflake.connect() which results in a warning:

/home/tim/.virtualenvs/django312/lib/python3.12/site-packages/snowflake/connector/__init__.py:55: UserWarning: 'is_spcs_connection' is an unknown connection parameter

For example, can we assume if HOST is provided that it's a spcs connection? Whatever the solution, it should be explained in the README.

@punitchauhan771
Copy link
Copy Markdown
Author

punitchauhan771 commented Jan 18, 2025

Hi Tim,

I’ve removed the is_spcs_connection and now use os.environ.get('SNOWFLAKE_SERVICE_NAME') to determine whether the connection is for SPCS. Since a service name is required whenever a service is created, we can use this as a flag to check if it’s within SPCS or not. Let me know if this works.

Thanks

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.

Add support for connecting to snowpark container services

2 participants