[Feature] Warn if duplicate columns are found in check
Snapshot strategy
#9656
Labels
enhancement
New feature or request
help_wanted
Trickier changes, with a clear starting point, good for previous/experienced contributors
snapshots
Issues related to dbt's snapshot functionality
Is this your first time submitting a feature request?
Describe the feature
Error if there are duplicate columns defined in the check_col configuration of a snapshot
Currently, the
check
strategy for Snapshots does not throw an error if there are duplicate column names specified in thecheck_cols
config, and accidentally specifying a column twice results in a record being inserted even if none of the column values changed.Recreation Steps (Tested on Snowflake and BigQuery)
test_staging.sql
:dupes_issue.sql
:dbt build -s +dupes_issue
. Inspect the results (you should only see one record).Describe alternatives you've considered
This is easily fixed by removing the duplicate column, but I believe we could make the user experience better in terms of troubleshooting.
Who will this benefit?
Anyone using snapshots!
Speaking from my own experience, this came from troubleshooting a snapshot with ~135 columns in the
check_col
config (which was looked at many times over about two weeks by me and another team). Having an error thrown at us would have saved all of us some time.Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: