Hello all! I'm running an anomaly test on Elementa...
# community-support
n
Hello all! I'm running an anomaly test on Elementary 0.16.1 and all rows (including those where there is no anomaly) are being inserted to
test_result_rows
. I tried setting the
test_sample_row_count
var to 5 in
dbt_project.yml
but nothing changed. I also tried passing the variable as a parameter in the dbt test command with no success. Has anyone run into this before? Am I missing something?
@Joost Boonzajer Flaes Just in case you've seen something like this before 🙂
j
Hi @Nicolas Escobar Jariton! Just so I understand, what exactly are you seeing in
test_result_rows
? Also - what are you using that table for?
n
I see all rows of every single test result, including those that are not anomalies. In some cases, the test brings hundreds of thousands of results and I don't want to store all of them in this table. I could disable test results altogether but I would like to see the anomalies in the edr report (which I believe uses
test_result_rows
as its source). My understanding was that
test_sample_row_count
was set to 5 by default so I was expecting only a sample to be included in that table.
j
I don't really understand what you mean with "every row of every single test result". Do you mean it stores all the failing rows for your test? Because for anomaly detection it should only store an aggregate per time bucket. How many dbt tests and models do you have?
n
For every test, it stores every row where an anomaly score is assigned, even if the anomaly score is below the threshold (that is, not an anomaly). This is not only per time bucket but also per dimension. This is an example of a test I'm running. For example, on one day, there were 200k "tested" rows but only 10 anomalies found. All 200k rows were inserted to
test_result_rows
. I only want the anomalies in that table.
Copy code
tests:
          - elementary.column_anomalies:
              column_anomalies:
                - average
              anomaly_sensitivity: 3
              dimensions:
                - id
                - publisher
                - platform
                - cohort_date
              training_period:
                period: day
                count: 14
              detection_period:
                period: day