Hey Team, I'm working on a test case on the `expe...
# community-support
j
Hey Team, I'm working on a test case on the
expect_column_proportion_of_unique_values_to_be_between
condition. We're basically checking for a condition where the min value is 0.9. Ideally, we want the test case to warn us if the value is less than 0.98. But throw an error if it drops below 0.9. I'm using the following condition and it doesn't compile successfully! It complained about the condition not having a minimum value. I'm going add
min_value: 0.91
just below the config bit.
Copy code
tests:
 - dbt_expectations.expect_column_proportion_of_unique_values_to_be_between:
  config:
   severity: warn
   error_if: "<0.9"
   warn_if: "<0.984"
Is there a better way of doing this? Thank you!
n
Hey JK! 🙂 This test requires a Min and Max configuration, this should work:
Copy code
tests:
  - dbt_expectations.expect_column_proportion_of_unique_values_to_be_between:
      min_value: 0.91  # Required
      max_value: 1.0   # Upper limit
      config:
        severity: warn
        error_if: "<0.9"
        warn_if: "<0.984"
See our dbt Test Hub for detailed explanations about all dbt packages and Elementary tests!
j
Hey @Noya Offer Thanks so much for the reply. Yes, I tried doing that and it compiled successfully. 🙂
🚀 2
n
Great! Happy to help 🙌🏼