Airflow error message

My 2cents without knowing your setup or restrictions!

TLDR: –project-dir flag

You’re able to use the dbt package which is great, but may need to examine your path during dag execution. Assuming you have a dbt_project.yml defined here /dbtproject/dbt_project.yml:

where_am_i = BashOperator(
    task_id="pathtest",
    bash_command="pwd"
    ....
)

If this is not {yourpathto}/dbtproject, then one of the following may help:

  1. bash_command="dbt run --project-dir /yourpathto/dbtproject"
  2. bash_command="cd /yourpathto/dbtproject && dbt run"

Additional:

  • potentially related thread
  • may need to adjust WORKDIR if in container or your python path
  • dbt cloud is a great (and free) product which includes task orchestration and scheduling: I resolved some airflow issues by converting