0
0
dbtdata~10 mins

PR review workflows for dbt changes - Interactive Code Practice

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

Complete the code to run dbt tests after a pull request is created.

dbt
steps:
  - name: Run dbt tests
    run: dbt [1]
Drag options to blanks, or click blank then click option'
Atest
Bcompile
Crun
Dbuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'run' instead of 'test' will execute models but not run tests.
Using 'build' compiles and runs models but does not run tests.
2fill in blank
medium

Complete the code to trigger dbt run only on changed models in the PR.

dbt
steps:
  - name: Run changed models
    run: dbt run --models [1]
Drag options to blanks, or click blank then click option'
Achanged
Bstate:modified
Csource:updated
Dtag:changed
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'state:modified' requires state comparison setup.
Using 'tag:changed' is invalid as 'changed' is not a tag.
3fill in blank
hard

Fix the error in the GitHub Actions step to cache dbt dependencies.

dbt
steps:
  - name: Cache dbt deps
    uses: actions/cache@v3
    with:
      path: ~/.dbt[1]
      key: ${{ runner.os }}-dbt-deps-[2]
Drag options to blanks, or click blank then click option'
A/packages ${{ hashFiles('**/packages.yml') }}
B/deps ${{ hashFiles('**/packages.yml') }}
C/deps ${{ hashFiles('**/dbt_project.yml') }}
D/packages ${{ hashFiles('**/dbt_project.yml') }}
Attempts:
3 left
💡 Hint
Common Mistakes
Using '/packages' instead of '/deps' for the path.
Hashing 'dbt_project.yml' instead of 'packages.yml' for the cache key.
4fill in blank
hard

Fill both blanks to create a job that runs dbt seed and then dbt run.

dbt
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install dependencies
        run: pip install dbt
      - name: Seed data
        run: dbt [1]
      - name: Run models
        run: dbt [2]
Drag options to blanks, or click blank then click option'
Aseed
Brun
Ctest
Dcompile
Attempts:
3 left
💡 Hint
Common Mistakes
Running 'dbt run' before 'dbt seed' may cause missing data errors.
Using 'dbt test' instead of 'dbt seed' to load data.
5fill in blank
hard

Fill all three blanks to create a workflow that installs dbt, caches dependencies, and runs tests.

dbt
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Cache dbt deps
        uses: actions/cache@v3
        with:
          path: ~/.dbt/[1]
          key: ${{ runner.os }}-dbt-deps-[2]
      - name: Install dbt
        run: pip install [3]
      - name: Run tests
        run: dbt test
Drag options to blanks, or click blank then click option'
Adeps
B${{ hashFiles('**/packages.yml') }}
Cdbt
Dpackages
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'packages' instead of 'deps' for the cache path.
Hashing 'dbt_project.yml' instead of 'packages.yml'.
Installing 'dbt-core' instead of 'dbt' (depending on adapter).