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
Parameters
Section titled “Parameters”| Name | Type | Description | Optional |
|---|---|---|---|
account | str | Snowflake account identifier. Required for password, key_pair and oauth auth_methods. | Yes |
warehouse | str | Snowflake warehouse. Required for password, key_pair, browser and oauth auth_methods. | Yes |
app_name | str | Snowflake Native App name. | No |
user | str | Snowflake username. Required for password and key_pair auth_methods. | Yes |
role | str | Snowflake role. Ensure this role has read permissions for input databases/schemas and write permissions for storing generated predictions. | No |
auth_method | str | Authentication 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 |
password | str | Snowflake password (required if auth_method is password) | Yes |
private_key_path | str | Path to private key file (required if auth_method is key_pair). | Yes |
private_key_passphrase | str | Optional passphrase for encrypted private key. | Yes |
oauth_token | str | OAuth access token (required if auth_method is oauth) | Yes |
host | str | Optional Snowflake host for OAuth authentication. | Yes |
Returns
Section titled “Returns”An instance of the Provider class.
Examples
Section titled “Examples”- 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;- 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)- Browser Authentication 🌐
snowflake_config = { "role":"<SNOWFLAKE_ROLE_WITH_ACCESS_TO_DB>", "warehouse": "<SNOWFLAKE_WAREHOUSE>", "app_name": "RELATIONALAI", "auth_method": "browser"}
provider = Provider(**snowflake_config)- 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)- Active Session Authentication 🟢
snowflake_config = { "app_name": "RELATIONALAI", "role":"<SNOWFLAKE_ROLE_WITH_ACCESS_TO_DB>", "auth_method": "active_session"}
provider = Provider(**snowflake_config)