elementary-data / elementary

The dbt-native data observability solution for data & analytics engineers. Monitor your data pipelines in minutes. Available as self-hosted or cloud service with premium features.
https://www.elementary-data.com/
Apache License 2.0
1.9k stars 159 forks source link

Missing max tests in report when defining it together with min tests #1662

Open retrry opened 1 month ago

retrry commented 1 month ago

Describe the bug Missing max tests, when defining tests in schema.yml

To Reproduce

  1. Define tests for model in schema.yml
  - elementary.column_anomalies:
      column_anomalies:
        - max
        - min
      column_name: "value_column"
      timestamp_column: "measured_at"
      training_period:
        period: month
        count: 1
      time_bucket:
        period: hour
        count: 12
      detection_delay:
        period: hour
        count: 12
      ignore_small_changes:
        spike_failure_percent_threshold: 10
        drop_failure_percent_threshold: 10
  1. Run dbt run && dbt test
  2. Run edr report

Expected behavior I expect to find min and max tests in generated report, but I only find min tests in the report.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context I have defined separate tests in schema.yml

  - elementary.column_anomalies:
      column_anomalies:
        - average
        - standard_deviation
        - variance
      column_name: "value_column"
      timestamp_column: "measured_at"
      training_period:
        period: month
        count: 1
      time_bucket:
        period: hour
        count: 12
      detection_delay:
        period: hour
        count: 12
  - elementary.column_anomalies:
      column_anomalies:
        - null_count
        - null_percent
        - zero_count
        - zero_percent
      column_name: "value_column"
      timestamp_column: "measured_at"
      training_period:
        period: month
        count: 1
      time_bucket:
        period: hour
        count: 12
      detection_delay:
        period: hour
        count: 12
      ignore_small_changes:
        spike_failure_percent_threshold: 15
        drop_failure_percent_threshold: 15

Would you be willing to contribute a fix for this issue? Not enough knowledge

ofek1weiss commented 1 month ago

Hey @retrry, i seem to be unable to reproduce this issue locally, can you share a screenshot of the report? with the relevant test result expanded like so:

Screenshot 2024-08-07 at 10 57 25
retrry commented 1 month ago

Hey, after more testing I see that I misidentified the problem. The tests are run correctly and if I select the model directly - I can see them, but for column anomalies only 1 of the tests is displayed in main results window.

Main results window: image

One model selected: image

haritamar commented 1 month ago

Hi @retrry ! Sorry for the delay here, I believe this is a bug we actually fixed but never released, we'll do so!

retrry commented 1 week ago

@haritamar any updates on this?