Skip to content

Provider

The Provider class is your gateway to managing GNN engines in Snowflake. It enables you to:

  • Create and delete GNN engines
  • List available engines
  • Resume suspended engines
  • Monitor engine status
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.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

An instance of the Provider class.

  1. Password Authentication 🔑
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"
}
provider = Provider(**snowflake_config)

To get your account name, run the following command in Snowflake:

SELECT CURRENT_ORGANIZATION_NAME() || '-' || CURRENT_ACCOUNT_NAME();

To find the RelationalAI application name, list all applications with:

SHOW APPLICATIONS;
  1. Key Pair Authentication 🔐
snowflake_config = {
"account": "<SNOWFLAKE_ACCOUNT>",
"user": "<SNOWFLAKE_USER>",
"private_key_path": "<SNOWFLAKE_PRIVATE_KEY_PATH>",
"role":"<SNOWFLAKE_ROLE_WITH_ACCESS_TO_DB>",
"warehouse": "<SNOWFLAKE_WAREHOUSE>",
"app_name": "RELATIONALAI",
"auth_method": "key_pair"
}
provider = Provider(**snowflake_config)
  1. Browser Authentication 🌐
snowflake_config = {
"role":"<SNOWFLAKE_ROLE_WITH_ACCESS_TO_DB>",
"warehouse": "<SNOWFLAKE_WAREHOUSE>",
"app_name": "RELATIONALAI",
"auth_method": "browser"
}
provider = Provider(**snowflake_config)
  1. OAuth Token Authentication 🔑
snowflake_config = {
"account": "<SNOWFLAKE_ACCOUNT>",
"oauth_token": "<SNOWFLAKE_ACCESS_TOKEN>",
"role":"<SNOWFLAKE_ROLE_WITH_ACCESS_TO_DB>",
"warehouse": "<SNOWFLAKE_WAREHOUSE>",
"app_name": "RELATIONALAI",
"auth_method": "oauth"
}
provider = Provider(**snowflake_config)
  1. Active Session Authentication 🟢
snowflake_config = {
"app_name": "RELATIONALAI",
"role":"<SNOWFLAKE_ROLE_WITH_ACCESS_TO_DB>",
"auth_method": "active_session"
}
provider = Provider(**snowflake_config)