snowflake
Snowflake connection configuration.
This module defines Pydantic models for configuring a Snowflake connection
backed by a Snowpark Session.
You typically use these models through Config by
adding a Snowflake connection entry under connections. The connection entry
can be provided as either:
- A Python dict (recommended for config files), or
- An instance of one of the authenticator classes (useful when building configs programmatically).
The authenticator is selected via the authenticator field in the config.
Supported values and their corresponding classes are:
"username_password"→UsernamePasswordAuth"username_password_mfa"→UsernamePasswordMFAAuth"externalbrowser"→ExternalBrowserAuth"jwt"→JWTAuth(key-pair authentication)"oauth_authorization_code"→OAuthAuthorizationCodeAuth(interactive OAuth PKCE)"oauth"→OAuthAuth"programmatic_access_token"→ProgrammaticAccessTokenAuth
These authenticator classes are re-exported from relationalai.config for
convenience.
All Snowflake authenticators share common fields like account and
warehouse, and optional fields like role, database, and schema.
Calling SnowflakeConnectionBase.get_session
creates and caches a Snowpark session on the connection instance; use
BaseConnection.clear_session_cache
to force a fresh session.
Examples
Section titled “Examples”Configure a Snowflake connection using a dict:
from relationalai.config import Configcfg = Config(connections={ "sf": { "type": "snowflake", "authenticator": "username_password", "account": "my_account", "warehouse": "my_warehouse", "user": "my_user", "password": "my_password", }})Configure a Snowflake connection using an authenticator class:
from relationalai.config import Config, UsernamePasswordAuthcfg = Config(connections={ "sf": UsernamePasswordAuth( account="my_account", warehouse="my_warehouse", user="my_user", password="my_password", )})Attributes
Section titled “Attributes”Attributes exposed by this module.
SnowflakeConnectionBase. Classes
Section titled “Classes”Classes exposed by this module.