Skip to content

snowflake

relationalai.config.connections

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:

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.

Configure a Snowflake connection using a dict:

from relationalai.config import Config
cfg = 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, UsernamePasswordAuth
cfg = Config(connections={
"sf": UsernamePasswordAuth(
account="my_account",
warehouse="my_warehouse",
user="my_user",
password="my_password",
)
})

Attributes exposed by this module.

Classes exposed by this module.