Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to run dbt models in a CI pipeline.
dbt
dbt run --[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--models' instead of '--select' which is the correct flag.
Using '--test' which runs tests, not models.
✗ Incorrect
The --select flag lets you specify which models to run in dbt.
2fill in blank
mediumComplete the code to run dbt tests in a CI pipeline.
dbt
dbt [1] --select state:modified Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' which runs models but does not run tests.
Using 'compile' which only compiles SQL but does not execute.
✗ Incorrect
The dbt test command runs tests on your models.
3fill in blank
hardFix the error in the GitHub Actions step to install dbt.
dbt
steps:
- name: Install dbt
run: pip [1] dbt-core Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'download' which is not a pip command.
Using 'remove' which uninstalls packages.
✗ Incorrect
To install dbt in a CI step, use pip install dbt-core.
4fill in blank
hardFill both blanks to run dbt commands only if the previous step succeeded.
dbt
jobs:
build:
steps:
- name: Run dbt models
if: [1] == 'success'
run: dbt [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'github.event_name' which is not the job status.
Using 'test' instead of 'run' for dbt command.
✗ Incorrect
The if condition checks if the job status is 'success'. Then it runs dbt run.
5fill in blank
hardFill all three blanks to create a dbt job that installs dependencies, runs models, and tests.
dbt
steps:
- name: Install dependencies
run: pip [1] dbt-core
- name: Run models
run: dbt [2]
- name: Run tests
run: dbt [3] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'compile' instead of 'test' for the last step.
Forgetting to install dbt before running commands.
✗ Incorrect
First, install dbt with pip install. Then run models with dbt run. Finally, run tests with dbt test.