Skip to content

SnowflakeConnector

Sends requests to a specific GNN engine for processing tasks.

NameTypeDescriptionOptional
accountstrSnowflake account identifier. Required for password, key_pair and oauth auth_methods.Yes
warehousestrSnowflake warehouse. Required for password, key_pair, browser and oauth auth_methods.Yes
app_namestrSnowflake Native App name.No
userstrSnowflake username. Required for password and key_pair auth_methods.Yes
rolestrSnowflake role. Ensure this role has read permissions for input databases/schemas and write permissions for storing generated predictions.No
auth_methodstrAuthentication method (password, key_pair, browser, oauth, or active_session). Use active_session when executing inside a Snowflake notebook. When using active_session, account, warehouse, user and role do not need to be set. Defaults to password.No
passwordstrSnowflake password (required if auth_method is password)Yes
private_key_pathstrPath to private key file (required if auth_method is key_pair).Yes
private_key_passphrasestrOptional passphrase for encrypted private key.Yes
oauth_tokenstrOAuth access token (required if auth_method is oauth)Yes
hoststrOptional Snowflake host for OAuth authentication.Yes
engine_namestrName of the GNN engine to send requests toNo

An instance of the SnowflakeConnector class.

All authentication methods available in the Provider examples can be used in the SnowflakeConnector too. In this example, we demonstrate password authentication. A convenient approach is to define a snowflake_config dictionary with your preferred method and pass it to both Provider and SnowflakeConnector.

from relationalai_gnns import SnowflakeConnector
snowflake_config = {
"account": "<SNOWFLAKE_ACCOUNT>",
"user": "<SNOWFLAKE_USER>",
"password": "<SNOWFLAKE_PASSWORD>",
"role":"<SNOWFLAKE_ROLE_WITH_ACCESS_TO_DB>",
"warehouse": "<SNOWFLAKE_WAREHOUSE>",
"app_name": "RELATIONALAI",
"auth_method": "password"
}
connector = SnowflakeConnector(
**snowflake_config,
engine_name = "engine_name"
)