Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set the test severity to 'warn'.
dbt
severity: [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'fail' which is not a valid severity level.
Confusing 'warn' with 'error'.
✗ Incorrect
The severity level warn marks the test as a warning instead of an error.
2fill in blank
mediumComplete the code to define a test with severity set to 'error'.
dbt
tests:
- unique:
column_name: id
severity: [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'skip' which disables the test.
Using 'warn' when an error is needed.
✗ Incorrect
Setting severity: error means the test failure will stop the run.
3fill in blank
hardFix the error in the test severity assignment.
dbt
tests:
- not_null:
column_name: email
severity: [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'warning' instead of 'warn'.
Using 'fail' which is invalid.
✗ Incorrect
The correct severity keyword is warn, not warning.
4fill in blank
hardFill both blanks to set a test severity to 'info' and disable failure.
dbt
tests:
- accepted_values:
column_name: status
values: ['active', 'inactive']
severity: [1]
fail_on_warn: [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting 'fail_on_warn' to true which causes failure.
Using 'warn' instead of 'info' for severity.
✗ Incorrect
Setting severity: info marks the test as informational, and fail_on_warn: false prevents failure on warnings.
5fill in blank
hardFill all three blanks to define a test with severity 'warn', disable failure on warn, and add a custom message.
dbt
tests:
- unique:
column_name: user_id
severity: [1]
fail_on_warn: [2]
message: '[3]' Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'true' for 'fail_on_warn' which causes failure.
Missing or incorrect custom message.
Using 'error' instead of 'warn' for severity.
✗ Incorrect
The test is set to warn severity, failure on warn is disabled with false, and a custom message is added.