How it Works
The not_constant test from dbt-utils™ validates that a column contains more than one distinct value. A column that is fully constant — where every row has the same value — is often a sign of a broken join, a hardcoded default, or an error in the transformation logic.
Steps and Conditions
Column Selection: Identify the column to validate.
Execution: The number of distinct values is computed.
Outcome: Pass if more than one distinct value exists; fail if the column is entirely uniform.
Example Usage: Event Tracking
An event tracking model should contain multiple distinct event types. If every row has the same event_type, it likely means a filter was accidentally hardcoded.
A constant event_type column would indicate only one type of event is being captured, which would severely limit the usefulness of the model for analytics.





