accepted_values

Feb 24, 2026

·

5

min read

Values set

·

dbt-core

·

Model,Column

How it Works

The accepted_values test is one of dbt™'s four built-in generic tests. It validates that every value in a column belongs to a predefined list of acceptable values. This is ideal for categorical columns like status codes, types, or classifications where the full value space is known and controlled.

The quote argument (default true) controls whether values are treated as strings.

Steps and Conditions

  1. Column Selection: Choose the column to validate.

  2. Define Allowed Values: List acceptable values using the values argument.

  3. Execution: Every row is checked against the allowed list.

  4. Outcome: Pass if all values are in the list; fail if any unlisted values appear.

Example Usage: Order Management

An order management system uses a fixed set of statuses. The team wants to ensure no unrecognized codes enter the system.

models:
  - name: orders
    columns:
      - name: status
        tests:
          - accepted_values:
              values: ['placed', 'processing', 'fulfilled', 'returned', 'cancelled'

models:
  - name: orders
    columns:
      - name: status
        tests:
          - accepted_values:
              values: ['placed', 'processing', 'fulfilled', 'returned', 'cancelled'

models:
  - name: orders
    columns:
      - name: status
        tests:
          - accepted_values:
              values: ['placed', 'processing', 'fulfilled', 'returned', 'cancelled'

Any order carrying an unrecognized status code will fail the test, protecting downstream logic that depends on these values.

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.