0
0
Snowflakecloud~10 mins

Integration with dbt and Airflow in Snowflake - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the Airflow operator that runs a dbt command.

Snowflake
dbt_task = [1](task_id='run_dbt', bash_command='run')
Drag options to blanks, or click blank then click option'
ASnowflakeOperator
BPythonOperator
CDummyOperator
DBashOperator
Attempts:
3 left
💡 Hint
Common Mistakes
Using PythonOperator instead of BashOperator for shell commands.
Confusing DummyOperator as it does not run commands.
2fill in blank
medium

Complete the code to set the Snowflake connection ID in Airflow for dbt.

Snowflake
snowflake_conn_id = '[1]'
Drag options to blanks, or click blank then click option'
Asnowflake_default
Bdbt_snowflake_conn
Cairflow_snowflake
Dsnowflake_conn
Attempts:
3 left
💡 Hint
Common Mistakes
Using a connection ID that does not exist in Airflow connections.
Confusing the connection ID with dbt profile names.
3fill in blank
hard

Fix the error in the Airflow DAG code to correctly trigger a dbt run command.

Snowflake
dbt_run = BashOperator(task_id='dbt_run', bash_command='dbt [1]')
Drag options to blanks, or click blank then click option'
Arun
Bbuild
Ctest
Dcompile
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'build' which is not a dbt CLI command.
Using 'test' which runs tests but does not build models.
4fill in blank
hard

Fill both blanks to define a dbt profile for Snowflake with correct keys.

Snowflake
"""
profiles:
  my_profile:
    target: dev
    outputs:
      dev:
        type: snowflake
        account: [1]
        user: [2]
"""
Drag options to blanks, or click blank then click option'
Aaccount_name
Busername
Cmy_account
Dmy_user
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic keys like 'account_name' instead of actual account identifier.
Confusing keys with values.
5fill in blank
hard

Fill in the blank to complete the Airflow DAG task dependencies for dbt run and test.

Snowflake
with DAG('dbt_dag', start_date=days_ago(1)) as dag:
    dbt_run = BashOperator(task_id='dbt_run', bash_command='dbt run')
    dbt_test = BashOperator(task_id='dbt_test', bash_command='dbt test')
    [1]
Drag options to blanks, or click blank then click option'
A>>
Bset_downstream
Cdbt_run >> dbt_test
Ddbt_test
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong operators like << or missing dependency lines.
Not placing the dependency line inside the DAG context.