What is the main purpose of using Airflow with dbt?
Airflow helps schedule and automate dbt tasks, so data transformations run reliably and on time without manual work.
Click to reveal answer
beginner
How does Airflow execute dbt commands?
Airflow runs dbt commands as tasks inside its workflows (DAGs), usually by calling shell commands or using operators designed for dbt.
Click to reveal answer
beginner
What is a DAG in Airflow?
A DAG (Directed Acyclic Graph) is a set of tasks with dependencies that Airflow runs in order. It defines the workflow for dbt jobs.
Click to reveal answer
intermediate
Why is it useful to separate dbt models into different Airflow tasks?
Separating models lets you control the order, retry failed parts, and monitor progress clearly, making the workflow more reliable and easier to manage.
Click to reveal answer
intermediate
What is the benefit of using Airflow sensors with dbt?
Sensors wait for certain conditions (like data availability) before starting dbt tasks, ensuring dbt runs only when data is ready.
Click to reveal answer
What does Airflow use to define the order of dbt tasks?
ADAG (Directed Acyclic Graph)
BSQL Query
CPython Script
DJSON File
✗ Incorrect
Airflow uses DAGs to define task order and dependencies.
Which Airflow component can wait for data before running dbt?
AOperator
BSensor
CHook
DExecutor
✗ Incorrect
Sensors wait for conditions like data availability before triggering tasks.
How do you run a dbt command inside Airflow?
AUsing Airflow sensors only
BWriting SQL in Airflow UI
CDirectly editing dbt models in Airflow
DUsing a dbt operator or BashOperator to run shell commands
✗ Incorrect
Airflow runs dbt commands by executing shell commands via operators.
What is a key benefit of orchestrating dbt with Airflow?
AAutomated scheduling and monitoring of dbt runs
BManual execution of dbt models
CReplacing dbt with Airflow
DWriting dbt models in Airflow
✗ Incorrect
Airflow automates scheduling and monitoring, making dbt runs reliable.
Which file typically defines an Airflow DAG for dbt tasks?
AYAML file
BJSON file
CPython file
Ddbt_project.yml
✗ Incorrect
Airflow DAGs are defined in Python files.
Explain how Airflow helps manage dbt workflows and why this is useful.
Think about how automation saves time and reduces errors.
You got /4 concepts.
Describe the role of sensors in Airflow when orchestrating dbt jobs.
Sensors act like gatekeepers before tasks start.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of using Airflow with dbt in data workflows?
easy
A. To automate and schedule dbt commands in a specific order
B. To replace dbt's SQL models with Python scripts
C. To visualize dbt models as charts
D. To manually run dbt commands from the command line
Solution
Step 1: Understand Airflow's role
Airflow is a tool to automate and schedule tasks, including dbt commands.
Step 2: Connect Airflow with dbt
Using Airflow, you can run dbt commands automatically and in order without manual intervention.
Final Answer:
To automate and schedule dbt commands in a specific order -> Option A
C. set_upstream expects a task object, not a string
D. BashOperator cannot run dbt commands
Solution
Step 1: Check set_upstream usage
set_upstream expects another task object, not a string task id.
Step 2: Identify correct usage
It should be dbt_test.set_upstream(dbt_run) where dbt_run is the task object, not 'dbt_run' string.
Final Answer:
set_upstream expects a task object, not a string -> Option C
Quick Check:
set_upstream needs task object = B [OK]
Hint: set_upstream needs task object, not string name [OK]
Common Mistakes:
Passing string instead of task object to set_upstream
Thinking bash_command must be a list
Believing task_id has naming restrictions
Assuming BashOperator can't run dbt
5. You want to create an Airflow DAG that runs dbt run, then dbt test, and finally sends an email notification only if tests pass. Which sequence correctly sets task dependencies?
hard
A. dbt_run >> email_notify >> dbt_test
B. email_notify >> dbt_run >> dbt_test
C. dbt_test >> dbt_run >> email_notify
D. dbt_run >> dbt_test >> email_notify
Solution
Step 1: Define correct task order
First, run models with dbt run, then test them with dbt test, and finally notify if tests pass.
Step 2: Set dependencies accordingly
Use '>>' to chain tasks in order: dbt_run >> dbt_test >> email_notify.
Final Answer:
dbt_run >> dbt_test >> email_notify -> Option D
Quick Check:
Run then test then notify = D [OK]
Hint: Chain tasks in order with >>: run, test, then notify [OK]
Common Mistakes:
Placing email notification before tests
Reversing run and test order
Skipping dependencies causing parallel runs
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.