# flyteplugins.snowflake

Key features:

- Parameterized SQL queries with typed inputs
- Key-pair and password-based authentication
- Returns query results as DataFrames
- Automatic links to the Snowflake query dashboard in the Flyte UI
- Query cancellation on task abort

Basic usage example:
```python
import flyte
from flyte.io import DataFrame
from flyteplugins.snowflake import Snowflake, SnowflakeConfig

config = SnowflakeConfig(
    account="myorg-myaccount",
    user="flyte_user",
    database="ANALYTICS",
    schema="PUBLIC",
    warehouse="COMPUTE_WH",
)

count_users = Snowflake(
    name="count_users",
    query_template="SELECT COUNT(*) FROM users",
    plugin_config=config,
    output_dataframe_type=DataFrame,
)

flyte.TaskEnvironment.from_task("snowflake_env", count_users)

if __name__ == "__main__":
    flyte.init_from_config()

    # Run locally (connector runs in-process, requires credentials and packages locally)
    run = flyte.with_runcontext(mode="local").run(count_users)

    # Run remotely (connector runs on the control plane)
    run = flyte.with_runcontext(mode="remote").run(count_users)

    print(run.url)
```
## Directory

### Classes

| Class | Description |
|-|-|
| [`Snowflake`](https://www.union.ai/docs/v2/union/api-reference/integrations/snowflake/packages/flyteplugins.snowflake/snowflake/page.md) |  |
| [`SnowflakeConfig`](https://www.union.ai/docs/v2/union/api-reference/integrations/snowflake/packages/flyteplugins.snowflake/snowflakeconfig/page.md) | Configure a Snowflake Task using a `SnowflakeConfig` object. |
| [`SnowflakeConnector`](https://www.union.ai/docs/v2/union/api-reference/integrations/snowflake/packages/flyteplugins.snowflake/snowflakeconnector/page.md) |  |

## Subpages

- [Snowflake](https://www.union.ai/docs/v2/union/api-reference/integrations/snowflake/packages/flyteplugins.snowflake/snowflake/page.md)
  - Parameters
  - Properties
  - Methods
  - aio()
  - config()
  - container_args()
  - custom_config()
  - data_loading_config()
  - execute()
  - forward()
  - override()
  - post()
  - pre()
  - sql()
- [SnowflakeConfig](https://www.union.ai/docs/v2/union/api-reference/integrations/snowflake/packages/flyteplugins.snowflake/snowflakeconfig/page.md)
  - Parameters
- [SnowflakeConnector](https://www.union.ai/docs/v2/union/api-reference/integrations/snowflake/packages/flyteplugins.snowflake/snowflakeconnector/page.md)
  - Methods
  - create()
  - delete()
  - get()
  - get_logs()
  - get_metrics()

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/integrations/snowflake/packages/flyteplugins.snowflake/_index.md
**HTML**: https://www.union.ai/docs/v2/union/api-reference/integrations/snowflake/packages/flyteplugins.snowflake/
