
Cosmos Dbt Fusion
Wire Apache Airflow Cosmos operators to dbt Fusion projects on Snowflake or Databricks with correct ProfileConfig and LOCAL execution mode.
Overview
Cosmos dbt Fusion is an agent skill for the Build phase that documents Cosmos ProfileConfig and operator_args for dbt Fusion on Snowflake and Databricks with LOCAL execution.
Install
npx skills add https://github.com/astronomer/agents --skill cosmos-dbt-fusionWhat is this skill?
- dbt Fusion limited to ExecutionMode.LOCAL with Snowflake or Databricks
- ProfileMapping table: SnowflakeUserPasswordProfileMapping and DatabricksTokenProfileMapping
- Required ProfileConfig fields: profile_name and target_name
- operator_args configuration section for Cosmos DAG tasks
- Airflow 3 compatibility notes in the reference doc
- Fusion supports only ExecutionMode.LOCAL
- Two warehouses in reference table: Snowflake and Databricks
Adoption & trust: 636 installs on skills.sh; 384 GitHub stars; 1/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need Airflow DAGs that run dbt Fusion correctly but Cosmos docs span adapters and Fusion-only limits are easy to violate.
Who is it for?
Solo builders shipping analytics pipelines with Astronomer Cosmos, Airflow 2/3, and dbt Fusion beta on Snowflake or Databricks.
Skip if: BigQuery-only stacks, Kubernetes execution mode expectations, or teams not using Airflow to schedule dbt.
When should I use this skill?
When configuring Cosmos for a dbt Fusion project with Snowflake or Databricks and LOCAL execution in Airflow.
What do I get? / Deliverables
Copy-paste-valid ProfileConfig and operator patterns for Fusion LOCAL runs tied to Airflow connections on supported warehouses.
- Valid ProfileConfig snippets
- Operator_args guidance for DAG tasks
- Warehouse-specific ProfileMapping examples
Recommended Skills
Journey fit
How it compares
Reference skill for Cosmos+Fusion wiring—not a replacement for dbt project semantics or full Astronomer Academy courses.
Common Questions / FAQ
Who is cosmos-dbt-fusion for?
Developers integrating dbt Fusion models into Airflow DAGs with Astronomer Cosmos on Snowflake or Databricks.
When should I use cosmos-dbt-fusion?
During Build integrations when authoring or reviewing DAG ProfileConfig, profile mappings, and operator_args for Fusion LOCAL execution.
Is cosmos-dbt-fusion safe to install?
It documents connection patterns that use Airflow secrets—review the Security Audits panel here and scope warehouse credentials via Airflow connections only.
SKILL.md
READMESKILL.md - Cosmos Dbt Fusion
# Cosmos Configuration Reference (Fusion) This reference covers Cosmos configuration for **dbt Fusion** projects. Fusion only supports `ExecutionMode.LOCAL` with Snowflake or Databricks warehouses. ## Table of Contents - [ProfileConfig: Warehouse Connection](#profileconfig-warehouse-connection) - [operator_args Configuration](#operator_args-configuration) - [Airflow 3 Compatibility](#airflow-3-compatibility) --- ## ProfileConfig: Warehouse Connection ### Supported ProfileMapping Classes (Fusion) | Warehouse | dbt Adapter Package | ProfileMapping Class | |-----------|---------------------|----------------------| | Snowflake | `dbt-snowflake` | `SnowflakeUserPasswordProfileMapping` | | Databricks | `dbt-databricks` | `DatabricksTokenProfileMapping` | > **Note**: Fusion currently only supports Snowflake and Databricks (public beta). ### Option A: Airflow Connection + ProfileMapping (Recommended) ```python from cosmos import ProfileConfig from cosmos.profiles import SnowflakeUserPasswordProfileMapping _profile_config = ProfileConfig( profile_name="default", # REQUIRED target_name="dev", # REQUIRED profile_mapping=SnowflakeUserPasswordProfileMapping( conn_id="snowflake_default", # REQUIRED profile_args={"schema": "my_schema"}, # OPTIONAL ), ) ``` **Databricks example:** ```python from cosmos import ProfileConfig from cosmos.profiles import DatabricksTokenProfileMapping _profile_config = ProfileConfig( profile_name="default", target_name="dev", profile_mapping=DatabricksTokenProfileMapping( conn_id="databricks_default", ), ) ``` ### Option B: Existing profiles.yml File > **CRITICAL**: Do not hardcode secrets in `profiles.yml`; use environment variables. ```python from cosmos import ProfileConfig _profile_config = ProfileConfig( profile_name="my_profile", # REQUIRED: must match profiles.yml target_name="dev", # REQUIRED: must match profiles.yml profiles_yml_filepath="/path/to/profiles.yml", # REQUIRED ) ``` --- ## operator_args Configuration The `operator_args` dict accepts parameters passed to Cosmos operators: | Category | Examples | |----------|----------| | BaseOperator params | `retries`, `retry_delay`, `on_failure_callback`, `pool` | | Cosmos-specific params | `install_deps`, `full_refresh`, `quiet`, `fail_fast` | | Runtime dbt vars | `vars` (string that renders as YAML) | ### Example Configuration ```python _operator_args = { # BaseOperator params "retries": 3, # Cosmos-specific params "install_deps": False, # if deps precomputed "full_refresh": False, # for incremental models "quiet": True, # only log errors } ``` ### Passing dbt vars at Runtime (XCom / Params) Use `operator_args["vars"]` to pass values from upstream tasks or Airflow params: ```python # Pull from upstream task via XCom _operator_args = { "vars": '{"my_department": "{{ ti.xcom_pull(task_ids=\'pre_dbt\', key=\'return_value\') }}"}', } # Pull from Airflow params (for manual runs) @dag(params={"my_department": "Engineering"}) def my_dag(): dbt = DbtTaskGroup( # ... operator_args={ "vars": '{"my_department": "{{ params.my_department }}"}', }, ) ``` --- ## Airflow 3 Compatibility ### Import Differences | Airflow 3.x | Airflow 2.x | |-------------|-------------| | `from airflow.sdk import dag, task` | `from airflow.decorators import dag, task` | | `from airflow.sdk import chain` | `from airflow.models.baseoperator import chain` | ### Asset/Dataset URI Format Change Cosmos ≤1.9 (Airflow 2 Datasets): ``` postgres://0.0.0.0:5434/postgres.public.orders ``` Cosmos ≥1.10 (Airflow 3 Assets): ``` postgres://0.0.0.0:5434/postgres/public/orders ``` > **CRITICAL**: If you have downstream DAGs scheduled on Cosmos-generated datasets and are upgrading to Airflow 3, update the asset URIs to the new format. --- name: cosmos-dbt-fusion description: Use when running a dbt Fusion project with Astron