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

create compare_all_columns macro that can be used in dbt test suite #49

Closed
leoebfolsom opened this issue Jul 14, 2022 · 0 comments
Closed
Labels
enhancement New feature or request

Comments

@leoebfolsom
Copy link
Contributor

Describe the feature

I would like to build a macro that can be used repeatedly to create dbt tests that test whether all column values match between two versions of dbt code.

This code should abstract away code that would be used for all such tests.

The idea is that I can run a single dbt test on a single table and say "ok, all those columns match up"; and like any dbt test, a single table is created in the warehouse for inspecting the results. (Writing the results to the log/console is great, but doesn't allow for programmatic/automatic checks.) Importantly, this lets dbt_audit_helper become part of a test suite in our production jobs and PR CI/CD.

Going forward, I would like to allow the test to receive arguments excluding columns that are expected to change, but this will provide useful functionality in the general case, and lead to expected test failures when a PR causes a data change.

Describe alternatives you've considered

  • Writing more verbose testing code
  • Running macros manually to test all columns and inspect results visually

Additional context

I will be building for Snowflake as this is the context in which we work--not sure if there will be db-specific needs.

Who will this benefit?

Anyone who wants to very rigorously test their changes as part of a dbt test suite.

Are you interested in contributing this feature?

Yup!

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

No branches or pull requests

1 participant