0
0
dbtdata~20 mins

Slim CI with state comparison in dbt - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Slim CI Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of dbt slim CI with state comparison command

What is the output of the following dbt command when using slim CI with state comparison?

dbt build --state path/to/previous_run --select state:modified

Assume the previous run had models A, B, and C, and only model B was modified.

dbt
dbt build --state path/to/previous_run --select state:modified
ABuilds only model B and its dependencies.
BBuilds all models A, B, and C regardless of changes.
CBuilds only models A and C, skipping B.
DBuilds no models because state comparison disables builds.
Attempts:
2 left
💡 Hint

Think about what 'state:modified' selects in dbt.

data_output
intermediate
2:00remaining
Number of models built with slim CI and state comparison

Given a dbt project with 10 models where 3 models were modified since the last run, how many models will be built using:

dbt build --state path/to/previous_run --select state:modified

Assuming no dependencies outside these 3 models.

dbt
dbt build --state path/to/previous_run --select state:modified
A10 models
B3 models
C0 models
DDepends on the number of dependencies of the modified models
Attempts:
2 left
💡 Hint

Consider if dependencies affect the count here.

🔧 Debug
advanced
2:00remaining
Identify the error in slim CI state comparison usage

What error will occur when running this command?

dbt build --state path/to/previous_run --select state:modified+ --exclude state:modified
dbt
dbt build --state path/to/previous_run --select state:modified+ --exclude state:modified
AError: Missing required --target flag.
BNo error, builds all models.
CError: Conflicting selection and exclusion of the same state selector.
DWarning: Ignoring --exclude flag.
Attempts:
2 left
💡 Hint

Think about what happens when you select and exclude the same models.

🚀 Application
advanced
2:00remaining
Applying slim CI with state comparison in a CI pipeline

You want to optimize your CI pipeline to only run tests on changed models and their dependencies. Which dbt command should you use?

Adbt test --state path/to/previous_run --exclude state:modified+
Bdbt test --select state:modified
Cdbt test --exclude state:modified
Ddbt test --state path/to/previous_run --select state:modified+
Attempts:
2 left
💡 Hint

Consider how to include dependencies of modified models.

🧠 Conceptual
expert
2:00remaining
Understanding limitations of slim CI with state comparison

Which of the following is a limitation of using slim CI with state comparison in dbt?

AIt may miss models affected by indirect dependency changes if state files are outdated.
BIt always rebuilds the entire project regardless of changes.
CIt cannot be used with incremental models.
DIt requires manual specification of changed models.
Attempts:
2 left
💡 Hint

Think about how state files affect detection of changes.