0
0
dbtdata~10 mins

Orchestrating dbt with Airflow - Interactive Code Practice

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

Complete the code to import the Airflow DAG class.

dbt
from airflow.[1] import DAG
Drag options to blanks, or click blank then click option'
Aoperators
Bmodels
Cdags
Dtasks
Attempts:
3 left
💡 Hint
Common Mistakes
Importing DAG from airflow.operators instead of airflow.models
Using incorrect module names like airflow.dags
2fill in blank
medium

Complete the code to create a dbt run task using BashOperator.

dbt
dbt_run = BashOperator(task_id='dbt_run', bash_command='dbt [1]')
Drag options to blanks, or click blank then click option'
Arun
Bcompile
Ctest
Dseed
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'dbt test' instead of 'dbt run' for model execution
Using 'dbt compile' which only compiles SQL without running
3fill in blank
hard

Fix the error in the DAG definition by completing the default_args dictionary key for retries.

dbt
default_args = {
    'owner': 'airflow',
    'start_date': days_ago(1),
    'retries': [1]
}
Drag options to blanks, or click blank then click option'
A'3'
BNone
CTrue
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Putting retries as a string like '3' causing type errors
Using boolean or None instead of an integer
4fill in blank
hard

Fill both blanks to set the schedule interval to daily and enable catchup.

dbt
dag = DAG('dbt_dag', default_args=default_args, schedule_interval=[1], catchup=[2])
Drag options to blanks, or click blank then click option'
A'@daily'
BFalse
CTrue
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Using None for schedule_interval which disables scheduling
Setting catchup to True causing unexpected backfills
5fill in blank
hard

Fill all three blanks to define task dependencies: dbt_run runs before dbt_test, which runs before dbt_docs.

dbt
dbt_run [1] dbt_test
 dbt_test [2] dbt_docs
 dag = DAG('dbt_dag', default_args=default_args, schedule_interval='@daily')
 dbt_docs = BashOperator(task_id='dbt_docs', bash_command='dbt docs generate')
Drag options to blanks, or click blank then click option'
A>>
D<<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<<' which reverses the order
Not setting dependencies causing tasks to run in parallel