{"id":1446,"library":"dbt-snowflake","title":"dbt-snowflake","description":"dbt-snowflake is the official adapter plugin for dbt (data build tool), enabling users to define, manage, and run data transformations against a Snowflake data warehouse. It extends dbt-core with Snowflake-specific SQL dialect, connection management, and materialization strategies. Current version is 1.11.4, and it is typically released in lockstep with dbt-core major and minor versions, meaning a quarterly or bi-annual cadence.","status":"active","version":"1.11.4","language":"en","source_language":"en","source_url":"https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-snowflake","tags":["dbt","snowflake","data-warehousing","etl","elt","sql-templating","adapter"],"install":[{"cmd":"pip install dbt-snowflake","lang":"bash","label":"Install dbt-snowflake"}],"dependencies":[{"reason":"dbt-snowflake is an adapter plugin for dbt-core and requires it for all functionality.","package":"dbt-core","optional":false}],"imports":[{"note":"Most end-users interact with dbt-snowflake via the dbt CLI; direct imports are typically for extending dbt's core functionality or advanced programmatic use cases.","symbol":"SnowflakeAdapter","correct":"from dbt.adapters.snowflake.impl import SnowflakeAdapter"},{"note":"Primarily for extending dbt's connection handling or for custom tooling. Not for typical dbt project usage.","symbol":"SnowflakeConnectionManager","correct":"from dbt.adapters.snowflake.connections import SnowflakeConnectionManager"}],"quickstart":{"code":"import os\nfrom pathlib import Path\n\n# Define minimal profiles.yml content using environment variables.\n# Make sure to set SNOWFLAKE_ACCOUNT, SNOWFLAKE_USER, SNOWFLAKE_PASSWORD,\n# SNOWFLAKE_ROLE, SNOWFLAKE_WAREHOUSE, SNOWFLAKE_DATABASE, SNOWFLAKE_SCHEMA\n# in your environment before running this, or replace the placeholders directly.\nprofiles_yml_content = f\"\"\"\ndbt_snowflake_example:\n  target: dev\n  outputs:\n    dev:\n      type: snowflake\n      account: {os.environ.get('SNOWFLAKE_ACCOUNT', 'your_account.snowflakecomputing.com')}\n      user: {os.environ.get('SNOWFLAKE_USER', 'your_snowflake_user')}\n      password: {os.environ.get('SNOWFLAKE_PASSWORD', 'your_snowflake_password')}\n      role: {os.environ.get('SNOWFLAKE_ROLE', 'SYSADMIN')}\n      warehouse: {os.environ.get('SNOWFLAKE_WAREHOUSE', 'COMPUTE_WH')}\n      database: {os.environ.get('SNOWFLAKE_DATABASE', 'DBT_DEV_DB')}\n      schema: {os.environ.get('SNOWFLAKE_SCHEMA', 'PUBLIC')}\n      threads: 1\n      client_session_keep_alive: false\n\"\"\"\n\n# Ensure ~/.dbt directory exists and write profiles.yml\ndbt_dir = Path.home() / \".dbt\"\ndbt_dir.mkdir(parents=True, exist_ok=True)\nprofiles_yml_path = dbt_dir / \"profiles.yml\"\nwith open(profiles_yml_path, \"w\") as f:\n    f.write(profiles_yml_content)\nprint(f\"Generated a sample profiles.yml at: {profiles_yml_path}\")\n\nprint(\"\\nNext steps:\")\nprint(\"1. Create a dbt project: `dbt init my_snowflake_project`\")\nprint(\"2. Update `my_snowflake_project/dbt_project.yml` to use `profile: dbt_snowflake_example`\")\nprint(\"3. Navigate into your project directory: `cd my_snowflake_project`\")\nprint(\"4. Verify your connection: `dbt debug`\")\nprint(\"   Ensure you have configured environment variables or replaced placeholders.\")\n\n# Uncomment the following to directly run dbt debug if you have dbt-core installed\n# import subprocess\n# try:\n#     print(\"\\nAttempting to run 'dbt debug' to verify connection...\")\n#     # This assumes you have created 'my_snowflake_project' and updated its profile\n#     # For a full quickstart, this requires more setup than a single snippet can provide.\n#     # subprocess.run([\"dbt\", \"debug\", \"--profile\", \"dbt_snowflake_example\"], check=True)\n#     # print(\"dbt debug completed successfully.\")\n# except FileNotFoundError:\n#     print(\"Error: 'dbt' command not found. Install dbt-core via `pip install dbt-core`.\")\n# except subprocess.CalledProcessError as e:\n#     print(f\"Error during 'dbt debug': {e}\")\n#     print(\"Check your profiles.yml and Snowflake credentials.\")","lang":"python","description":"This Python script generates a minimal `profiles.yml` file in your `~/.dbt/` directory, configured for Snowflake using environment variables for credentials. After running this script, follow the printed instructions to initialize a dbt project, link it to the generated profile, and run `dbt debug` to verify your Snowflake connection. Remember to set the required Snowflake environment variables (e.g., `SNOWFLAKE_ACCOUNT`, `SNOWFLAKE_USER`, `SNOWFLAKE_PASSWORD`) or replace placeholders."},"warnings":[{"fix":"Always check the dbt-core release notes and upgrade `dbt-snowflake` in tandem with `dbt-core` using `pip install --upgrade dbt-core dbt-snowflake`.","message":"Breaking changes in `dbt-core`'s adapter interface frequently require corresponding updates in `dbt-snowflake`. Ensure your `dbt-snowflake` version is compatible with your `dbt-core` version (e.g., dbt-core 1.x requires dbt-snowflake 1.x).","severity":"breaking","affected_versions":"All versions when upgrading dbt-core major/minor versions (e.g., 0.x to 1.x, 1.0 to 1.1)."},{"fix":"Run `dbt debug` within your dbt project to diagnose connection issues. Verify all Snowflake connection parameters and ensure environment variables (if used) are correctly set.","message":"Incorrect or incomplete Snowflake profile configuration in `profiles.yml` is the most common issue. Pay close attention to `account`, `user`, `password` (or key pair), `role`, `warehouse`, `database`, and `schema`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your Python environment meets the `requires_python` specification for both `dbt-core` and `dbt-snowflake`. Use a virtual environment to manage dependencies.","message":"Python version compatibility. `dbt-core` and its adapters specify minimum Python versions (e.g., 3.8+ for 1.0, 3.10+ for 1.11+). Using an unsupported Python version will lead to installation or runtime errors.","severity":"gotcha","affected_versions":"All versions, specifically when upgrading dbt-core/dbt-snowflake."},{"fix":"Consult your IT team and Snowflake documentation for network requirements. Test connectivity outside dbt (e.g., using `snowsql` CLI or a simple Python `snowflake-connector-python` script).","message":"Network connectivity issues (firewalls, proxy settings, private link configurations) can prevent dbt-snowflake from connecting to Snowflake, even with correct credentials.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}