Rafael Olszewski
05/07/2025, 8:18 PMkapa.ai
05/07/2025, 8:18 PMkapa.ai
05/07/2025, 8:18 PMyaml models: - name: your_model_name tests: - elementary.volume_anomalies Key points: - Do not set timestamp_column. - The test will take a "snapshot" of the row count at each run and compare it to previous snapshots. - You may want to reduce the training period (e.g., days_back) if you want the test to start flagging anomalies sooner than the default 14 runs. Reference: This approach is described in detail by Elementary support: > "If you don't define a timestamp column for this table, we will simply save the entire row count of the table when the test runs... once we have enough data we can use it to alert on anomaly" [Slack thread](https://slack.com/archives/C02CTC89LAX/p1650989426047689). Also, the documentation confirms that omitting timestamp_column will count the table's total rows and compare them across runs [volume_anomalies documentation](https://docs.elementary-data.com/data-tests/anomaly-detection-tests/volume-anomalies). If you want the test to be sensitive to any drop (not just statistical anomalies), you may need to adjust the anomaly_sensitivity parameter, but the default behavior should already flag significant drops. Note: If you need to flag even a single-row drop (i.e., strictly greater than or equal), Elementary’s anomaly detection is based on statistical analysis and may not catch very small changes unless configured for high sensitivity. For strict constraints (e.g., "row count must never decrease"), you might also consider using a dbt-expectations test like expect_table_row_count_to_be_between, which can be included in Elementary reports as well [Slack thread](https://slack.com/archives/C02CTC89LAX/p1677563837770559).