Skip to content

[Feature] Allow setting the data test where config on the model level #12021

@jeremyyeo

Description

@jeremyyeo

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

dbt should support setting the where test config (https://docs.getdbt.com/reference/resource-configs/where#examples) on the model level - e.g.

models:
  - name: foo
    config:
      where: "date_column = current_date"
    columns:
      - name: c1
        tests:
          - not_null
          - unique
      - name: c2
        tests:
          - not_null
          - unique

Describe alternatives you've considered

Users need to rewrite the where config multiple times for each test / use yaml anchors / etc.

Who will this benefit?

Users who want to keep things DRY.

Are you interested in contributing this feature?

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions