astonomer-cosmos --select

I’m trying the new astonomer-cosmos to orchestrate dbt with airflow. Anyone knows how to run only a specific model (i.e. dbt run --select my_model)? I managed only to run the entire project through the DbtTaskGroup:

with DAG(
    dag_id="dbt_test",
    start_date=datetime(2022, 11, 27),
    doc_md=__doc__,
    catchup=False,
    default_args={"owner":"test"},
) as dag:

    # run the entire project
    dbt_run = DbtTaskGroup(
        dbt_project_name="dbt_test",
        conn_id="redshift",
        dbt_args={
            "schema": "test",
            "dbt_executable_path": "/usr/local/airflow/dbt_venv/bin/dbt",
        }
    )

Hi Leonard! With Cosmos, you can use the select/exclude to pick certain models, tags, etc. Check out the docs here:

https://astronomer.github.io/astronomer-cosmos/dbt/configuration.html#selecting-and-excluding

Hi. I opened an issue and the problem was the documentation. They fixed it.
Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.