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

Add expect_table_column_count_to_equal_other_table_times_factor #37

Conversation

nysthee
Copy link
Contributor

@nysthee nysthee commented Apr 9, 2021

Hi

We have a use case where we have a table a and we want to validate that table b always has a row count that is equal to the row count in table a times a predefined factor.

@nysthee nysthee force-pushed the feature/add-row-count-count-to-equal-other-table-times-factor branch from 9503293 to 9b72523 Compare April 9, 2021 11:24
@nysthee nysthee force-pushed the feature/add-row-count-count-to-equal-other-table-times-factor branch from 9b72523 to 6d95d96 Compare April 9, 2021 11:25
Copy link
Contributor

@clausherther clausherther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nysthee, thanks for submitting this, looks great. I added a small comment re: the integration, but I'll leave it up to you if you want to change that. Let me know either way and I'll go ahead and merge once you're ready.

@@ -117,6 +117,9 @@ models:
max_value: 4
- dbt_expectations.expect_table_row_count_to_equal_other_table:
compare_model: ref("data_test")
- dbt_expectations.expect_table_row_count_to_equal_other_table_times_factor:
compare_model: ref("data_test")
factor: 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe introduce a new test column that is factored up something other than 1?

@nysthee
Copy link
Contributor Author

nysthee commented Apr 9, 2021 via email

@nysthee
Copy link
Contributor Author

nysthee commented Apr 9, 2021

hi @clausherther

I added a new model with factor 2 number of rows of the original table (didn't bother with the content since we only care about the number of rows)

@clausherther
Copy link
Contributor

@nysthee looks good, thanks!

@clausherther clausherther merged commit 60fa675 into calogica:main Apr 9, 2021
@clausherther
Copy link
Contributor

I will cut a new release this weekend, might wrap some other work into that. Thanks again for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants