The problem I’m having
When I run the dbt models in the environment version above I get the following error.
[2023-08-22, 14:19:03 UTC] {dbt.py:176} ERROR - An error has ocurred while executing dbt seed
Traceback (most recent call last):
File "/opt/python3.8/lib/python3.8/site-packages/airflow_dbt_python/operators/dbt.py", line 170, in execute
result = self.dbt_hook.run_dbt_task(
File "/opt/python3.8/lib/python3.8/site-packages/airflow_dbt_python/hooks/dbt.py", line 222, in run_dbt_task
from dbt.config.runtime import UnsetProfileConfig
ImportError: cannot import name 'UnsetProfileConfig' from 'dbt.config.runtime' (/opt/python3.8/lib/python3.8/site-packages/dbt/config/runtime.py)
[2023-08-22, 14:19:03 UTC] {taskinstance.py:1778} ERROR - Task failed with exception
Traceback (most recent call last):
File "/opt/python3.8/lib/python3.8/site-packages/airflow_dbt_python/operators/dbt.py", line 170, in execute
result = self.dbt_hook.run_dbt_task(
File "/opt/python3.8/lib/python3.8/site-packages/airflow_dbt_python/hooks/dbt.py", line 222, in run_dbt_task
from dbt.config.runtime import UnsetProfileConfig
ImportError: cannot import name 'UnsetProfileConfig' from 'dbt.config.runtime' (/opt/python3.8/lib/python3.8/site-packages/dbt/config/runtime.py)
The context of why I’m trying to do this
My environment is setup on GCP and we use Airflow for our data dags. The same models are running in other projects. The only difference being the version of composer and dbt
The models run in composer-2.0.24-airflow-2.2.5 with dbt version 1.2.0
I have to upgrade composer but am not sure about the resolution. Googling with the error did not help either
What I’ve already tried
Some example code or error messages
Put code inside backticks
to preserve indentation
which is especially important
for Python and YAML!