They should accept one or both of these arguments: model and column_name.
B.
They must contain a {{ ref() }} snippet to a model.
C.
They do not need to be specified under a model's YAML configurations.
D.
They should always accept a column_name.
E.
They are written using the {% macro %} wrapper.
The Answer Is:
E
This question includes an explanation.
Explanation:
The correct answer is E: They are written using the {% macro %} wrapper.
Generic tests in dbt are implemented as macros, which means they must be defined using the {% macro %} Jinja syntax. These macros return a SQL query that evaluates to rows representing test failures. dbt executes these queries and marks the test as failed if any rows are returned. This requirement is explicitly documented: all generic tests are macros located in a test directory or within a package.
Option A is partially correct but not universal. Generic tests typically accept arguments such as model or column_name, but dbt does not require both or either. Custom tests can accept any parameters defined by the user. Option B is incorrect because tests do not require ref(); dbt injects the model relation for you when the test is executed. Option C is false because generic tests must be declared in YAML under a model or source for dbt to run them. Option D is incorrect because tests do not always need a column_name (e.g., relationship tests, row-count tests, table-level validations).
Therefore, the defining and universally required characteristic is that generic tests are written as macros, making E the correct answer.
dbt-Analytics-Engineering PDF/Engine
Printable Format
Value of Money
100% Pass Assurance
Verified Answers
Researched by Industry Experts
Based on Real Exams Scenarios
100% Real Questions
Get 65% Discount on All Products,
Use Coupon: "ac4s65"