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

[Feature Request] Allow for percentage of rows to be null #238

Open
rlh1994 opened this issue Jan 25, 2023 · 6 comments
Open

[Feature Request] Allow for percentage of rows to be null #238

rlh1994 opened this issue Jan 25, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@rlh1994
Copy link

rlh1994 commented Jan 25, 2023

Is your feature request related to a problem? Please describe.
We have a column that most of the time should not be null, but we allow some tolerance in this due to the way the data is sourced, currently there is no test that allows for a proportion of the records in a column to be null, it's all or nothing.

Describe the solution you'd like
A test (or option in an existing test) that calculated the proportion of (not) null records and compares it against some specified tolerance.

Describe alternatives you've considered
Creating a custom test or not testing at all.

Additional context

@clausherther clausherther added the enhancement New feature or request label Jan 25, 2023
@danhphan
Copy link

danhphan commented Feb 2, 2023

Hi @clausherther I'm happy to work on this feature.

@clausherther
Copy link
Contributor

@danhphan that'd be amazing, thanks! 👏 Let me know if I can help with anything. I think we already have a couple of tests that implemented some sort of tolerance level.

@danhphan
Copy link

danhphan commented Feb 4, 2023

Yes, let me look into the code base and its tests in more details. Thank you!

@marcellovictorino
Copy link

This is an amazing feature! Any updates?

@sambloom92
Copy link

@rlh1994 you can set tolerances for any test in terms of the absolute number of failing records:

- not_null:
  - config:
    - error_if: ">1000"
    - warn_if: ">500"
   

But it would be a nice enhancement if you could specify it as a proportion rather than an absolute number...

@emishas
Copy link

emishas commented Mar 18, 2024

dbt-utils has this feature
https://github.com/dbt-labs/dbt-utils/tree/1.1.1/#not_null_proportion-source

              - dbt_utils.not_null_proportion:
                  at_least: 0.99

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

6 participants