Snowflake-Labs / sfquickstarts

Follow along with our tutorials to get you up and running with the Snowflake Data Cloud.
Apache License 2.0
297 stars 562 forks source link

No dbt_project.yml found error when running Airflow DAG #1381

Open tyukei opened 2 weeks ago

tyukei commented 2 weeks ago

Describe the bug Following the tutorial on Snowflake's Quickstarts for data engineering with Apache Airflow, an error occurs when executing the Airflow DAG. The error indicates that the dbt_project.yml file is not found at the expected path.

URL of where you see the bug https://github.com/Snowflake-Labs/sfquickstarts/blob/master/site/sfguides/src/data_engineering_with_apache_airflow_ja/data_engineering_with_apache_airflow_ja.md

To Reproduce Steps to reproduce the behavior:

  1. Go to https://quickstarts.snowflake.com/guide/data_engineering_with_apache_airflow_ja/index.html?index=..%2F..index#7
  2. Follow the steps to set up and run the Airflow DAG.
  3. Observe the error message when the DAG is executed.

Expected behavior The Airflow DAG should execute successfully, finding the dbt_project.yml file at the specified path.

Desktop (please complete the following information):

Additional context Error Message:

No dbt_project.yml found at expected path /dbt/dbt_project.yml

Original code in https://quickstarts.snowflake.com/guide/data_engineering_with_apache_airflow_ja/index.html?index=..%2F..index#1

  volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    - ./dbt:/dbt # add this in
    - ./dags:/dags # add this in

Fix To resolve the issue, update the docker-compose.yml file to include the following lines:

  volumes:
    - ./dags:/opt/airflow/dags
    - ./logs:/opt/airflow/logs
    - ./plugins:/opt/airflow/plugins
    - ${AIRFLOW_PROJ_DIR:-.}/dbt:/dbt # add this in
    - ${AIRFLOW_PROJ_DIR:-.}/dags:/dags # add this in

This change will ensure that the necessary directories are correctly mapped, allowing Airflow to find the dbt_project.yml file.

Thanks!