You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my dbt project, I encountered a limitation with the check-source-has-tests-by-group hook in the pre-commit configuration, specifically when trying to exclude specific models that do not have grain. These models are defined within a single YAML file.
According to the dbt-checkpoint exclusion documentation, exclusion seems to apply only to entire files rather than specific models or tables within those files.
I have attempted couple ways to specify the exclusions in more granular way, including using file paths and adjusting the exclude parameter's placement. But I have not successfully excluded specific models from the grain test requirement.
For example, I tried using the file path by leveling down to table name. This is something shown in issue #119
- id: check-source-has-tests-by-group
description: "Ensures that the model has a number of tests"
args: ["--tests", "unique", "expect_compound_columns_to_be_unique", "--test-cnt","1", "--exclude","models/tablename", "--"]
Workaround:
I've temporarily resolved this by segregating the non-grain models into separate YAML files and applying a regex pattern in the pre-commit configuration to exclude those files: exclude: ^models/staging/.*/.*nongrain\.yml$
Request:
Is this a limitation/bug or an area for a new feature? Currently, I'm managing exclusions for grain tests, but similar needs may arise for other tests. The requirement to create separate YAML files for different exclusions leads to a fragmented project structure.
I'm hoping for a solution that allows for exclusions at a more granular level, ideally through fully qualified names (fqn) or a similar method that supports specific models or tables within a YAML file. This enhancement would streamline configurations and maintain a cohesive project structure.
The text was updated successfully, but these errors were encountered:
Background:
In my dbt project, I encountered a limitation with the
check-source-has-tests-by-group
hook in the pre-commit configuration, specifically when trying to exclude specific models that do not have grain. These models are defined within a single YAML file.According to the dbt-checkpoint exclusion documentation, exclusion seems to apply only to entire files rather than specific models or tables within those files.
I have attempted couple ways to specify the exclusions in more granular way, including using file paths and adjusting the exclude parameter's placement. But I have not successfully excluded specific models from the grain test requirement.
For example, I tried using the file path by leveling down to table name. This is something shown in issue #119
Workaround:
I've temporarily resolved this by segregating the non-grain models into separate YAML files and applying a regex pattern in the pre-commit configuration to exclude those files:
exclude: ^models/staging/.*/.*nongrain\.yml$
Request:
Is this a limitation/bug or an area for a new feature? Currently, I'm managing exclusions for grain tests, but similar needs may arise for other tests. The requirement to create separate YAML files for different exclusions leads to a fragmented project structure.
I'm hoping for a solution that allows for exclusions at a more granular level, ideally through fully qualified names (fqn) or a similar method that supports specific models or tables within a YAML file. This enhancement would streamline configurations and maintain a cohesive project structure.
The text was updated successfully, but these errors were encountered: