not_constant

Feb 24, 2026

·

5

min read

Uniqueness

·

dbt-utils

·

Model,Column

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

  1. Column Selection: Identify the column to validate.

  2. Execution: The number of distinct values is computed.

  3. 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.

models:
  - name: user_events
    columns:
      - name: event_type
        tests

models:
  - name: user_events
    columns:
      - name: event_type
        tests

models:
  - name: user_events
    columns:
      - name: event_type
        tests

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.

Interested to Learn More?
Try Out the Free 14-Days Trial

More Articles

decorative icon

Experience Analytics for the AI-Era

Start your 14-day trial today - it's free and no credit card needed

decorative icon

Experience Analytics for the AI-Era

Start your 14-day trial today - it's free and no credit card needed

decorative icon

Experience Analytics for the AI-Era

Start your 14-day trial today - it's free and no credit card needed

Copyright © 2026 Paradime Labs, Inc.

Made with ❤️ in San Francisco ・ London

*dbt® and dbt Core® are federally registered trademarks of dbt Labs, Inc. in the United States and various jurisdictions around the world. Paradime is not a partner of dbt Labs. All rights therein are reserved to dbt Labs. Paradime is not a product or service of or endorsed by dbt Labs, Inc.

Copyright © 2026 Paradime Labs, Inc.

Made with ❤️ in San Francisco ・ London

*dbt® and dbt Core® are federally registered trademarks of dbt Labs, Inc. in the United States and various jurisdictions around the world. Paradime is not a partner of dbt Labs. All rights therein are reserved to dbt Labs. Paradime is not a product or service of or endorsed by dbt Labs, Inc.

Copyright © 2026 Paradime Labs, Inc.

Made with ❤️ in San Francisco ・ London

*dbt® and dbt Core® are federally registered trademarks of dbt Labs, Inc. in the United States and various jurisdictions around the world. Paradime is not a partner of dbt Labs. All rights therein are reserved to dbt Labs. Paradime is not a product or service of or endorsed by dbt Labs, Inc.