dbt Tests

not_accepted_values

dbt-utils

·

Model,Column

·

Values set

How it Works

The not_accepted_values test from dbt-utils™ is the logical complement of the built-in accepted_values test. It asserts that a column contains no values from a specified list. This is useful for enforcing data quality rules where certain values should never appear — for example, deprecated status codes, placeholder strings, or system-generated sentinel values.

Steps and Conditions

  1. Column Selection: Choose the column to validate.

  2. Define Disallowed Values: List the values that must not appear using the values argument.

  3. Execution: Each row is checked against the disallowed list.

  4. Outcome: Pass if no disallowed values are found; fail if any are present.

Example Usage: CRM Platform

A CRM platform decommissioned several legacy lead source codes. The team wants to ensure these codes are fully purged from the active leads table.

models:
  - name: leads
    columns:
      - name: lead_source
        tests:
          - dbt_utils.not_accepted_values:
              values: ['imported_legacy', 'manual_entry_v1', 'unknown_source'

models:
  - name: leads
    columns:
      - name: lead_source
        tests:
          - dbt_utils.not_accepted_values:
              values: ['imported_legacy', 'manual_entry_v1', 'unknown_source'

models:
  - name: leads
    columns:
      - name: lead_source
        tests:
          - dbt_utils.not_accepted_values:
              values: ['imported_legacy', 'manual_entry_v1', 'unknown_source'

Any appearance of these deprecated codes triggers a test failure, alerting the team to investigate the source of stale data.

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

Stop Managing Pipelines. Start Shipping Them.

Join the teams that replaced manual dbt™ workflows with agentic AI. Free to start, no credit card required.

Stop Managing Pipelines. Start Shipping Them.

Join the teams that replaced manual dbt™ workflows with agentic AI. Free to start, no credit card required.

Stop Managing Pipelines. Start Shipping Them.

Join the teams that replaced manual dbt™ workflows with agentic AI. Free to start, no credit card required.

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.