Bird
Raised Fist0
dbtdata~20 mins

PR review workflows for dbt changes - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
dbt PR Review Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Key Step in PR Review Workflow for dbt Model Changes

In a typical PR review workflow for dbt model changes, which step ensures that the new or modified models do not break existing data transformations?

AMerging the PR directly without any checks
BRunning dbt tests and validations on the changed models
CDeleting the existing models before merging
DIgnoring the PR and continuing development
Attempts:
2 left
💡 Hint

Think about how to verify that changes are safe before merging.

❓ Predict Output
intermediate
1:30remaining
Output of dbt run in PR Workflow

What is the expected output when running dbt run during a PR review for a model that has no syntax errors and passes all dependencies?

dbt
dbt run
AAll models run successfully with status 'OK' and no errors
BSyntax errors reported and run aborted
CPartial models run with some failures
DNo output is shown
Attempts:
2 left
💡 Hint

Consider what happens when dbt runs models without issues.

🔧 Debug
advanced
2:00remaining
Identifying the Cause of a Failed dbt Test in PR Review

During a PR review, a dbt test fails with the error: unique key violation. What is the most likely cause?

AThe test syntax is incorrect
BThe dbt project configuration file is missing
CThe database connection is lost
DThe model contains duplicate values in a column that should be unique
Attempts:
2 left
💡 Hint

Think about what a unique key violation means in data.

🚀 Application
advanced
2:30remaining
Best Practice for Handling Schema Changes in PR Workflow

When a PR includes schema changes like adding a new column to a dbt model, what is the best practice to ensure smooth deployment?

AAdd the new column in the model and update tests and documentation accordingly before merging
BMerge the PR without updating tests or documentation
CDelete the old model and create a new one with the new schema
DIgnore schema changes and only update SQL logic
Attempts:
2 left
💡 Hint

Think about maintaining quality and clarity in your dbt project.

❓ visualization
expert
3:00remaining
Interpreting a dbt DAG Graph in PR Review

You see a DAG graph generated by dbt during a PR review. The graph shows a model with multiple upstream dependencies and several downstream models. What does this imply about the impact of changes to this model?

AChanges to this model only affect itself and no other models
BThis model has no dependencies and is isolated
CChanges to this model can affect many other models both upstream and downstream
DThe graph is incorrect and should be ignored
Attempts:
2 left
💡 Hint

Consider what upstream and downstream dependencies mean in a DAG.

Practice

(1/5)
1. What is the main purpose of using a PR (Pull Request) review workflow in dbt projects?
easy
A. To ensure changes are reviewed and tested before merging
B. To speed up merging without checks
C. To delete old branches automatically
D. To create new dbt models without review

Solution

  1. Step 1: Understand PR review workflow purpose

    PR review workflows are designed to check code changes carefully before they become part of the main project.
  2. Step 2: Identify the correct purpose in dbt context

    In dbt, this means reviewing and testing data models to avoid errors and keep the project reliable.
  3. Final Answer:

    To ensure changes are reviewed and tested before merging -> Option A
  4. Quick Check:

    PR review = review and test before merge [OK]
Hint: PR reviews catch errors before merging [OK]
Common Mistakes:
  • Thinking PRs speed up merging without checks
  • Confusing PR reviews with branch deletion
  • Assuming PRs create models automatically
2. Which of the following is the correct syntax to create a new branch for a dbt PR workflow using Git?
easy
A. git branch new-feature
B. git merge new-feature
C. git push new-feature
D. git checkout -b new-feature

Solution

  1. Step 1: Understand Git branch creation commands

    To create and switch to a new branch in one step, use git checkout -b branch-name.
  2. Step 2: Identify the correct command for new branch creation

    git checkout -b new-feature uses git checkout -b new-feature, which creates and switches to the branch.
  3. Final Answer:

    git checkout -b new-feature -> Option D
  4. Quick Check:

    New branch creation = git checkout -b [OK]
Hint: Use git checkout -b to create and switch branch [OK]
Common Mistakes:
  • Using git branch without switching
  • Confusing merge with branch creation
  • Trying to push before creating branch
3. Given this simplified dbt test command in a PR workflow:
dbt test --models my_model

What will happen if the model my_model has a failing test?
medium
A. The command deletes the model automatically
B. The command completes successfully with no error
C. The command fails and returns a non-zero exit code
D. The command ignores the test and continues

Solution

  1. Step 1: Understand dbt test behavior

    When a dbt test fails, the command returns a non-zero exit code indicating failure.
  2. Step 2: Identify the effect of a failing test in PR workflow

    This failure stops the PR from merging until the issue is fixed.
  3. Final Answer:

    The command fails and returns a non-zero exit code -> Option C
  4. Quick Check:

    Failing test = command fails with error code [OK]
Hint: Failing dbt tests cause command to fail [OK]
Common Mistakes:
  • Assuming tests pass silently
  • Thinking dbt deletes models on failure
  • Believing tests are ignored automatically
4. You wrote a dbt model and created a PR, but the automated tests fail. Which of the following is the best way to debug the issue?
medium
A. Ignore the test failures and merge the PR
B. Check the test logs and fix the model SQL accordingly
C. Delete the model file and close the PR
D. Merge the PR and fix errors later in production

Solution

  1. Step 1: Understand the role of test logs in debugging

    Test logs show which tests failed and why, helping identify SQL errors or data issues.
  2. Step 2: Choose the correct debugging approach

    Fixing the model SQL based on logs ensures the PR passes tests before merging.
  3. Final Answer:

    Check the test logs and fix the model SQL accordingly -> Option B
  4. Quick Check:

    Debug by reviewing logs and fixing code [OK]
Hint: Use test logs to find and fix errors [OK]
Common Mistakes:
  • Ignoring test failures
  • Deleting models unnecessarily
  • Merging broken code into main branch
5. In a team using dbt with PR review workflows, which combination of practices best ensures data model quality before merging?
hard
A. Create feature branches, run automated tests, and require team approval
B. Directly commit to main branch and run tests after merging
C. Skip tests and rely on manual checks only
D. Merge PRs without reviews to speed up deployment

Solution

  1. Step 1: Identify best practices in PR workflows

    Using feature branches isolates changes, automated tests catch errors early, and team approval ensures quality review.
  2. Step 2: Compare options to find the best combination

    Create feature branches, run automated tests, and require team approval includes all these practices, while others skip important steps or risk errors.
  3. Final Answer:

    Create feature branches, run automated tests, and require team approval -> Option A
  4. Quick Check:

    Branch + tests + review = quality assurance [OK]
Hint: Combine branches, tests, and reviews for quality [OK]
Common Mistakes:
  • Committing directly to main branch
  • Skipping automated tests
  • Merging without team review
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard