gocardless/airflow-dbt

use of vars results in invalid dbt run command

robmarkcole opened this issue · 1 comments

Reading the source vars is used like:

dbt_run = DbtRunOperator(
    task_id="dbt_run",
    models="MY_MODEL",
    vars={"EXECUTION_DATE": "{{ ds }}"},
)

This generates an invalid dbt command where vars is formatted like:

--vars {"EXECUTION_DATE": "2020-12-22"}

What is valid is:

--vars '{"EXECUTION_DATE": "2020-12-22" }'

noting the extra '

I believe this is a bug.

dbt=0.18
airflow=1.10.14

OK this was a red herring, the error was arising due to a broken dbt model. I didn't know that dbt will compile all models in a project even if only a single model is to be run.
Cheers