Skip to content

Extend Missing Primary Key Tests to include dbt.constraints PK test #517

@Pirognoe

Description

@Pirognoe

Describe the feature

I would like to add additional option no. 4 to Missing Primary Key Tests test to include dbt_constraints.primary_key test from https://github.com/Snowflake-Labs/dbt_constraints/tree/main

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

After adding a snippet like below

columns:
      - name: account_sid
        description: Primary key
        data_tests:
          - dbt_utils.at_least_one
          - dbt_constraints.primary_key

I already check my column for PK validity, but for Missing Primary Key Tests I still need to add the following test, which are essentially duplicates of the above

constraints:
          - type: not_null
        data_tests:
          - dbt_constraints.primary_key
          - dbt_utils.at_least_one
          - unique

Who will this benefit?

Teams using both packages

Are you interested in contributing this feature?

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