0
0
dbtdata~10 mins

Why production dbt needs automation - Test Your Understanding

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

Complete the code to run dbt models automatically using the command line.

dbt
import os
os.system('dbt [1]')
Drag options to blanks, or click blank then click option'
Arun
Bcompile
Cdocs
Dtest
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'compile' only prepares SQL but does not run models.
Using 'test' runs tests but does not build models.
Using 'docs' generates documentation only.
2fill in blank
medium

Complete the code to schedule dbt runs using a cron job syntax.

dbt
0 [1] * * * dbt run
Drag options to blanks, or click blank then click option'
A23
B0
C6
D12
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 runs at midnight, not noon.
Using 23 runs late at night.
Using 6 runs early morning.
3fill in blank
hard

Fix the error in the dbt command to run tests automatically after models build.

dbt
os.system('dbt run && dbt [1]')
Drag options to blanks, or click blank then click option'
Arun
Bcompile
Ctest
Dseed
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' twice does not run tests.
Using 'compile' only prepares SQL.
Using 'seed' loads CSV data, not tests.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that filters models with more than 3 columns.

dbt
filtered_models = {model: len(columns) [1] model, columns in models.items() if len(columns) [2] 3}
Drag options to blanks, or click blank then click option'
Afor
B>
C<
Dif
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'if' instead of 'for' in the first blank causes syntax error.
Using '<' filters models with fewer columns, not more.
5fill in blank
hard

Fill all three blanks to create a dictionary of model names in uppercase with their column counts, filtering only models with columns greater than 5.

dbt
result = [1]: [2] for model, cols in models.items() if [3] > 5
Drag options to blanks, or click blank then click option'
Amodel.upper()
Blen(cols)
Dmodel
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'model' instead of 'model.upper()' loses uppercase keys.
Using 'model' in condition instead of 'len(cols)' causes error.
Mixing up blanks causes syntax errors.