Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messaging for snapshots: unique-key error #10864

Open
3 tasks done
hope-wat opened this issue Oct 16, 2024 · 0 comments
Open
3 tasks done

Improve error messaging for snapshots: unique-key error #10864

hope-wat opened this issue Oct 16, 2024 · 0 comments
Labels
enhancement New feature or request triage

Comments

@hope-wat
Copy link

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

I would like to improve our snapshot error messaging to improve developer experience so they know the next logical step to take in altering their code.

When you pass a unique_key that isn't actually unique you get the error:

Duplicate row detected during DML action
  Row Values: [redacted]
  compiled code at target/run/central_data_team_partner_eng_inc/snapshots/snapshots_testing/vendor_snapshot.yml

This currently leads to a rabbit hole of querying data like to uncover the problem when it's actually pretty obvious.

SELECT id_given_to_my_unique_key, COUNT(*)
FROM db.schema.table
GROUP BY id_given_to_my_unique_key
HAVING COUNT(*) > 1;

I would like this to give a suggestion such as Ensure the unique_key column(s) are really unique.
I think this would better tie out to our docs on this point "Ensure your unique key is really unique".

Describe alternatives you've considered

Alternatives are to go to the compiled code the error message sends you to. Then you have to go back to your warehouse and find the root cause data.

Who will this benefit?

All users using snapshots to ensure they are configuring them correctly.

Are you interested in contributing this feature?

yes if necessary

Anything else?

This is a low lift improvement to our error messaging that can contribute to user delight!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage
Projects
None yet
Development

No branches or pull requests

1 participant