Exam dbt-Analytics-Engineering Topic 1 Question 112 Discussion
Actual exam question for dbt Labs's dbt-Analytics-Engineering exam
Question #: 112
Topic #: 1
Question #: 112
Topic #: 1
Examine this query:
select *
from {{ ref('stg_orders') }}
where amount_usd < 0
You want to make this a generic test across multiple models.
Which set of two standard arguments should be used to replace {{ ref('stg_orders') }} and amount_usd?
Choose 1 option.
select *
from {{ ref('stg_orders') }}
where amount_usd < 0
You want to make this a generic test across multiple models.
Which set of two standard arguments should be used to replace {{ ref('stg_orders') }} and amount_usd?
Choose 1 option.
Suggested Answer: B Vote an answer
When converting a model-specific SQL query into a generic test, dbt expects the test macro to accept the two standard arguments used across all generic tests: model and column_name. These arguments allow dbt to automatically pass the correct table and the correct column when the test is applied in YAML.
The argument model represents the actual relation (table/view) being tested. dbt compiles the reference itself-so instead of writing ref('stg_orders'), generic tests always use {{ model }} to represent the referenced relation.
The argument column_name represents the actual column being tested. In this case, the hard-coded column amount_usd becomes the dynamic argument {{ column_name }}, allowing you to apply the logic to any numeric or validated column across multiple models.
So the generic version of your SQL becomes:
select *
from {{ model }}
where {{ column_name }} < 0
The other options are incorrect:
* source is not the standard argument for generic tests.
* model_name is not automatically passed by dbt.
* field is not a recognized standard test argument.
Thus, the two correct standard arguments are model and column_name.
The argument model represents the actual relation (table/view) being tested. dbt compiles the reference itself-so instead of writing ref('stg_orders'), generic tests always use {{ model }} to represent the referenced relation.
The argument column_name represents the actual column being tested. In this case, the hard-coded column amount_usd becomes the dynamic argument {{ column_name }}, allowing you to apply the logic to any numeric or validated column across multiple models.
So the generic version of your SQL becomes:
select *
from {{ model }}
where {{ column_name }} < 0
The other options are incorrect:
* source is not the standard argument for generic tests.
* model_name is not automatically passed by dbt.
* field is not a recognized standard test argument.
Thus, the two correct standard arguments are model and column_name.
by Isidore at Nov 20, 2026, 04:48 PM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).