Lucie Nováková
02/01/2024, 1:44 PMdbt_project.yml file (such as ‘elementary’, ‘tests’, etc.), but haven’t had any success. 😞
Is it possible to define this configuration at the project level? If so, could you guide me on the correct placement within the dbt_project.yml file?
Thank you in advance for your help!Renee Cooper
02/01/2024, 4:08 PMLucie Nováková
02/01/2024, 4:38 PMvars:
timestamp_column: 'TIMESTAMP_COLUMN'
anomaly_sensitivity: 1
detection_period:
period: day
count: 2
training_period:
period: month
count: 10
time_bucket:
period: week
count: 1
detection_delay:
period: day
count: 2
And here’s my model-specific configuration:
models:
- name: MODEL_NAME
tests:
- elementary.freshness_anomalies:
timestamp_column: 'TIMESTAMP_COLUMN'
anomaly_sensitivity: 1
detection_period:
period: day
count: 2
training_period:
period: month
count: 10
time_bucket:
period: week
count: 1
detection_delay:
period: day
count: 2
I can’t understand why the two configs are producing different results. Can anyone explain?Ofek Weiss
02/05/2024, 12:57 PMvars section of your dbt project will not work, as these are project variables and not test configurations.
if you wish to set the configuration for elementary test on a scale higher then a specific test, you can do it on a model level, like so:
models:
- name: MODEL_NAME
config:
elementary:
timestamp_column: 'TIMESTAMP_COLUMN'
anomaly_sensitivity: 1
detection_period:
period: day
count: 2
training_period:
period: month
count: 10
time_bucket:
period: week
count: 1
detection_delay:
period: day
count: 2
tests:
- elementary.volume_anomaliesRenee Cooper
02/05/2024, 1:37 PMOfek Weiss
02/05/2024, 2:08 PMvars section of the project should work drop shocked
@Lucie Nováková can you share the graph of the different configurations? id like to try to see what is going on thereLucie Nováková
02/05/2024, 4:41 PMdays_back_start is calculated differently: In the model-specific configuration, the date 2023-04-09 is used, which I believe corresponds to a 10-month training period. On the other hand, the vars configuration uses the date 2024-01-20. I’m not sure of the origin of this date.Ofek Weiss
02/07/2024, 2:33 PMOfek Weiss
02/08/2024, 1:08 PMdetection_period and training_period specifically are only supported on a test level.
This is a bug 🐛 , Im working on a fix 👷♂️, but in the meantime you will need to set those on a test levelRobert Gillin
02/13/2024, 7:41 PM- name: model_1
meta:
owner: "@me"
description: '{{ doc("model_1_desc") }}'
config:
elementary:
timestamp_column: timestamp_at_pt
columns:
- name: metric_1
description: '{{ doc("metric_1_desc") }}'
tests:
- elementary.column_anomalies:
column_anomalies:
- sum
where_expression: "some_field = 'some_value'"
time_bucket:
period: day
count: 1
tags: [ 'elementary' ]
The timestamp_column does not propagate down to the column_anomalies test. If I move the timestamp_column under the test config, then the timestamp_column config variable is passed into the test (see below):
columns:
- name: metric_1
description: '{{ doc("metric_1_desc") }}'
tests:
- elementary.column_anomalies:
timestamp_column: timestamp_at_pt
column_anomalies:
- sum
where_expression: "some_field = 'some_value'"
time_bucket:
period: day
count: 1
tags: [ 'elementary' ]
Regardless though, I’ve been trying to set an anomaly_sensitivity for this test, have tried a global config, model config and test config to no avail. When I have the anomaly_sensitivity set at the test level I get an error saying that specific param is not available for column_anomalies .
The first thing I will say is the documentation for all_column_anomalies and column_anomalies is very confusing. But there does seem to be a bug with the column_anomalies. I’ve tried discussing this with other elementary folks and no one has been able to give me an answer.Ofek Weiss
02/14/2024, 7:44 AMelementary are you using?Robert Gillin
02/14/2024, 11:43 PMversion: 0.7.1Robert Gillin
02/15/2024, 12:02 AMRobert Gillin
02/15/2024, 6:05 PM