QuestionQ12

Verified

An analyst on your team has reported that the business logic creating the is_active column in your stg_users model is incorrect.

You update the column logic to:

case when state = 'Active'  
then true else false end as is_active  

Which test can you add to the state column to support your expectations of the source data? Choose 1 option.

Explanation

An accepted_values test on state checks that non-null values belong to the expected set, while not_null rejects nulls. State values need not be unique across users. The lowercase active in the accepted list must be reconciled with Active in the SQL logic when comparisons are case-sensitive. (docs.getdbt.com)

In dbt v2, test inputs such as values must be nested under arguments. (docs.getdbt.com)

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!