{"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":"python","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`. If installing on a minimal OS (e.g., Alpine Linux) or with a very new Python version for which pre-built wheels are not available, you may need to install development packages (e.g., `build-base` on Alpine or `python3-dev gcc` on Debian-based systems) or use a more stable Python version/OS combination.","message":"Python version compatibility. `dbt-core` and its adapters specify minimum Python versions. Using an unsupported Python version (e.g., a pre-release like 3.13) will often lead to installation or runtime errors. If no pre-built wheels are available for your Python version and operating system (especially on minimal environments like Alpine), installation may fail during source compilation if required build tools (like `g++`) are missing.","severity":"gotcha","affected_versions":"All versions, specifically when upgrading dbt-core/dbt-snowflake or using pre-release Python versions."},{"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,"search_vec":"'1.11.4':50 'adapt':10,84 'annual':72 'bi':71 'bi-annu':70 'build':15 'cadenc':73 'connect':42 'core':35,61 'current':47 'data':14,24,29,77 'data-wareh':76 'dbt':2,5,13,34,60,74 'dbt-core':33,59 'dbt-snowflak':1,4 'defin':20 'dialect':41 'elt':80 'enabl':17 'etl':79 'extend':32 'lockstep':57 'major':62 'manag':21,43 'materi':45 'mean':66 'minor':64 'offici':9 'plugin':11 'quarter':68 'releas':55 'run':23 'snowflak':3,6,28,38,75 'snowflake-specif':37 'specif':39 'sql':40,82 'sql-templat':81 'strategi':46 'templat':83 'tool':16 'transform':25 'typic':54 'user':18 'version':48,65 'wareh':78 'warehous':30","created_at":"2026-04-09T03:48:17.303791+00:00","updated_at":"2026-04-16T05:50:45.038519+00:00","problems":[{"fix":"Double-check your `profiles.yml` for typos in `account`, `user`, and `password`. Ensure the Snowflake user's password has not changed or the OAuth connection has not expired; if using OAuth, reconnect your Snowflake account via dbt Cloud profile settings. Running `dbt debug` can help pinpoint connection issues.","cause":"This error indicates that dbt-snowflake could not establish a connection to your Snowflake account because the provided credentials (username or password) in your `profiles.yml` file are incorrect, the account identifier is wrong, or an OAuth token has expired.","error":"Failed to connect to DB: <account_identifier>.snowflakecomputing.com:443. Incorrect username or password was specified."},{"fix":"Verify that the specified object (`<object_name>`) exists in Snowflake. Grant the appropriate `USAGE` and `SELECT` (or `CREATE`/`INSERT` for transformations) permissions to the Snowflake role used by dbt on the database, schema, and table/view. Check the compiled SQL in `target/compiled/` to see the exact query dbt is trying to run and ensure correct quoting of identifiers if they are case-sensitive.","cause":"This error occurs when dbt attempts to execute SQL against a Snowflake object (database, schema, table, view, etc.) that either does not exist, or the Snowflake user/role configured in `profiles.yml` does not have the necessary permissions to access it.","error":"SQL compilation error: Object '<object_name>' does not exist or not authorized."},{"fix":"Ensure that the `warehouse` parameter is correctly defined in your `profiles.yml` under the Snowflake target. Confirm that the Snowflake user/role specified in your profile has `USAGE` privilege on the specified warehouse, or manually set a default warehouse for the user in Snowflake via `ALTER USER <user_name> SET DEFAULT_WAREHOUSE = '<existing_warehouse_name>';`.","cause":"The Snowflake connection defined in your `profiles.yml` or the default role assigned to the user does not have a valid or accessible warehouse specified, or the `warehouse` parameter is missing or incorrect in your dbt profile, which is particularly common for `dbt seed` operations.","error":"Database Error 000606 (57P03): No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command."},{"fix":"Review the Jinja or Python code where the error occurs and identify the variable or function call that is unexpectedly returning `None`. Ensure all variables are properly initialized, that `ref()` and `source()` calls point to existing, accessible models/sources, and that Python models correctly generate their output dataframe. For Jinja, add `{% if variable_name is not none %}` checks or use `default('')` to provide a fallback string.","cause":"This Python error typically happens when a Jinja expression or Python logic within a dbt macro or model expects a string (or an object with a `.replace()` method) but receives a `None` value instead. This can occur if a variable is not initialized, a `ref()` or `source()` call returns no object, or a function doesn't return a value as expected.","error":"'NoneType' object has no attribute 'replace'"},{"fix":"Ensure your `profiles.yml` explicitly defines a `schema` parameter for your target. Review the model's configuration and the generated SQL (in `target/run/`) to confirm fully qualified names are being used where necessary. For dynamic tables, ensure the `snowflake_initialization_warehouse` parameter is correctly configured if applicable, and that the database and schema are explicit.","cause":"This Snowflake error indicates that a DDL operation (like `CREATE TABLE`) was attempted without an active schema in the session context, and the object name was not fully qualified with a database and schema. dbt sometimes encounters this when the default schema context is not correctly propagated or implicitly available, especially with dynamic tables or specific materialization strategies.","error":"Cannot perform CREATE TABLE. This session does not have a current schema. Call 'USE SCHEMA', or use a qualified name."}],"ecosystem":"pypi","meta_description":null,"install_score":45,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.12.0","cli_name":"dbt","cli_version":"Core:","type":"library","homepage":"https://getdbt.com","github":"https://github.com/dbt-labs/dbt-adapters","docs":"https://docs.getdbt.com","changelog":"https://github.com/dbt-labs/dbt-adapters/blob/main/dbt-snowflake/CHANGELOG.md","pypi":"https://pypi.org/project/dbt-snowflake/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-27","next_check":"2026-07-28","install_tag":"draft"}}