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 argument to allow for same number of rows to pass fewer_rows_than test #851

Closed
dalpert opened this issue Oct 30, 2023 · 3 comments
Closed
Labels
enhancement New feature or request Stale triage

Comments

@dalpert
Copy link

dalpert commented Oct 30, 2023

Describe the feature

Currently in the fewer_rows_than test, the model must have fewer rows than the compare_model for the test to pass. The two tables having the same number of rows returns 1, which fails the test. I would like to add an argument that would allow for two tables having the same number of rows to pass this test, effectively making it a fewer_or_equal_rows_than test.

For implementation, I imagine something like a pass_if_equal flag that is set to false by default (not changing the current functionality at all) but setting it to true would allow for the two tables having equal rows to pass.

Describe alternatives you've considered

  • Considered making a test that has this functionality locally.
  • Have looked at the dbt_expectations package for this functionality but similarly have not found it.

Who will this benefit?

This is probably fairly niche, but for anyone wanting to test tables that could have a 1:1 relationship between rows or something less, but not more, this would be useful. For example I have a transform that under certain circumstances could collapse multiple rows in one table into one row in a downstream table. The downstream table should have fewer than or the equal rows to the upstream table.

Are you interested in contributing this feature?

I'm interested in contributing this feature -- I don't think it should be super hard to do, but it's my first time contributing here.

@dalpert dalpert added enhancement New feature or request triage labels Oct 30, 2023
@dalpert
Copy link
Author

dalpert commented Nov 7, 2023

@dbt-labs/oss-maintainers seeing a few more places where having this functionality would be useful. Would love some input on adding this functionality!

Copy link

github-actions bot commented May 6, 2024

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 6, 2024
Copy link

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale triage
Projects
None yet
Development

No branches or pull requests

1 participant