- elementary.freshness_anomalies: argume...
# ask-elementary-ai
m
- elementary.freshness_anomalies: arguments: timestamp_column: date_sdc_updated tags: [ "ELEMENTARY_FRESHNESS" ] detection_period: period: "day" count: 1 - elementary.volume_anomalies: arguments: timestamp_column: date_sdc_updated tags: ["ELEMENTARY_VOLUME"] detection_period: period: "day" count: 7 ignore_small_changes: spike_failure_percent_threshold: 20 drop_failure_percent_threshold: 20 anomaly_direction: both anomaly_sensitivity: 0.5 how can i set the severity at warning for these tests?
k
A message from kapa.ai
To set the severity to "warn" for your Elementary anomaly detection tests, you should add a
config
block with
severity: warn
under each test. Here’s how your YAML should look:
Copy code
yaml - elementary.freshness_anomalies:     arguments:       timestamp_column: date_sdc_updated       tags: [ "ELEMENTARY_FRESHNESS" ]       detection_period:         period: "day"         count: 1     config:       severity: warn  - elementary.volume_anomalies:     arguments:       timestamp_column: date_sdc_updated       tags: ["ELEMENTARY_VOLUME"]       detection_period:         period: "day"         count: 7       ignore_small_changes:         spike_failure_percent_threshold: 20         drop_failure_percent_threshold: 20       anomaly_direction: both       anomaly_sensitivity: 0.5     config:       severity: warn
This approach is supported and recommended for Elementary tests, as it works the same way as for other dbt tests. Setting
severity: warn
ensures that test failures will not block downstream model builds, but will still be reported as warnings [Configure your elementary anomaly detection tests](https://docs.elementary-data.com/data-tests/add-elementary-tests#configure-your-elementary-anomaly-detection-tests), [Slack example](https://elementary-community.slack.com/archives/C02CTC89LAX/p1709141168413439?thread_ts=1709141168.413439&cid=C02CTC89LAX). If you want to apply this setting globally to all Elementary tests, you can try adding the following to your `dbt_project.yml`:
Copy code
yaml tests:   elementary:     +severity: warn
However, there are reports that this project-level setting may not always work as expected for all users or versions, so specifying
config: severity: warn
per test is the most reliable method [Slack discussion](https://elementary-community.slack.com/archives/C02CTC89LAX/p1711559815403719?thread_ts=1711559815.403719&cid=C02CTC89LAX).