shobia
10/30/2025, 6:02 AMkapa.ai
10/30/2025, 6:02 AMkapa.ai
10/30/2025, 6:02 AMnull_count and null_percent on the column "Amount Extended Price Base Currency" using the elementary.column_anomalies test. Both null_count and null_percent are supported monitors for any column type, including numeric columns like this one. Here’s how you can define the test in your dbt model YAML: yaml - name: sales_backlog__parquet_common_refined4 columns: - name: "Amount Extended Price Base Currency" quote: true tests: - elementary.column_anomalies: column_anomalies: [null_count, null_percent] This configuration will monitor the number and percentage of nulls in the specified column over time and alert if there is a significant anomaly compared to historical data. The test will pass if no anomaly is detected and fail if an anomaly is found in the detection period, based on the statistical model Elementary uses to compare recent values to historical trends [column_anomalies docs](https://docs.elementary-data.com/data-tests/anomaly-detection-tests/column-anomalies). ### How thresholds work Elementary’s anomaly detection does not use static user-defined thresholds for nulls. Instead, it uses statistical anomaly detection, comparing recent values to historical patterns. However, you can control the sensitivity of the anomaly detection using the anomaly_sensitivity parameter. A lower value makes the test more sensitive (alerts on smaller changes), while a higher value makes it less sensitive (alerts only on larger deviations). For example: yaml - name: "Amount Extended Price Base Currency" quote: true tests: - elementary.column_anomalies: column_anomalies: [null_count, null_percent] anomaly_sensitivity: 2 You can also configure other parameters such as timestamp_column, detection_period, training_period, and more, to fine-tune how the anomaly detection works [anomaly params](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/anomaly-params). ### About your YAML structure Your example uses data_tests, but Elementary tests should be defined under the tests key for each column or model, as shown above. The structure you provided for the elementary.column_anomalies test is correct if placed under the tests key for the column. Summary: - Yes, you can and should use null_count and null_percent for this column. - The test will fail if an anomaly is detected in the null count or percent, based on historical data. - You can adjust detection sensitivity with anomaly_sensitivity. - Use the tests key, not data_tests, for Elementary test definitions in your YAML. For more details and configuration options, see the official documentation: [column_anomalies configuration](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/column-anomalies), [test configuration](https://docs.elementary-data.com/data-tests/anomaly-detection-tests/column-anomalies#test-configuration).shobia
10/30/2025, 6:05 AMkapa.ai
10/30/2025, 6:05 AMkapa.ai
10/30/2025, 6:05 AMnull_count and null_percent on the column "Amount Extended Price Base Currency" with anomaly_sensitivity: 4. This configuration is suitable when you expect some nulls and want to reduce false positives by making the test less sensitive to small changes. yaml version: 2 models: - name: sales_backlog__parquet_common_refined4 columns: - name: "Amount Extended Price Base Currency" quote: true tests: - elementary.column_anomalies: column_anomalies: [null_count, null_percent] anomaly_sensitivity: 4 Explanation: - The test will monitor both the count and percent of nulls in the specified column. - anomaly_sensitivity: 4 makes the test less sensitive, so only significant deviations from historical null patterns will trigger a failure. - This structure follows the documented approach for configuring column anomaly tests in dbt YAML files [column_anomalies configuration](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/column-anomalies) and [test configuration](https://docs.elementary-data.com/data-tests/anomaly-detection-tests/column-anomalies#test-configuration). If you want to add a timestamp_column for time-based anomaly detection, you can add it at the model level as shown in the documentation, but it is not required for the test to work. Let me know if you need the structure for additional columns or further customization!