<@U088WCP3B4P> i'd like to add test the freshness ...
# ask-elementary-ai
t
@kapa.ai i'd like to add test the freshness of a dbt model without specifying the timestamp_column. how should i do ? i haven't declared it and get the following error :
Missing mandatory configuration: ['timestamp_column']
k
A message from kapa.ai
To use the
elementary.freshness_anomalies
test, specifying a
timestamp_column
is mandatory. If you do not declare it, you will get the error:
Missing mandatory configuration: ['timestamp_column']
. This is by design—Elementary requires a timestamp column to calculate and monitor the freshness of your data over time. There is no supported way to run a freshness anomaly test without providing a timestamp column, as the test logic depends on it to create time buckets and measure update intervals. If your table does not have a timestamp column, you cannot use the
freshness_anomalies
test. You may consider using other tests, such as
volume_anomalies
, which do not require a timestamp column and will operate on the entire table instead of time buckets. But for freshness, the timestamp is essential and required by the test configuration [Freshness anomalies test configuration](https://docs.elementary-data.com/data-tests/anomaly-detection-tests/freshness-anomalies). Here’s an example of the required configuration:
Copy code
yaml models:   - name: my_model     tests:       - elementary.freshness_anomalies:           timestamp_column: my_timestamp_column  # This is mandatory
If you do not have a suitable timestamp column, you will need to add one to your model or use a different test that does not require it.
t
@kapa.ai but based on the documentation here https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/timestamp-column, it seems possible not to specify the timestamp
k
A message from kapa.ai
You are correct that for many Elementary anomaly detection tests (like
volume_anomalies
,
column_anomalies
, and
all_columns_anomalies
), specifying a
timestamp_column
is optional. If you do not provide it, the test will operate on the entire table and compare metrics between test runs, rather than using time buckets. This is clearly described in the documentation and confirmed in community discussions [see here](https://docs.elementary-data.com/data-tests/anomaly-detection-configuration/timestamp-column). However, for the
freshness_anomalies
test specifically, the documentation and configuration examples state that the
timestamp_column
is mandatory. The test logic requires a timestamp to measure the time between data updates and to split the data into time buckets. If you omit it, you will get the error you described:
Missing mandatory configuration: ['timestamp_column']
 [see here](https://docs.elementary-data.com/data-tests/anomaly-detection-tests/freshness-anomalies). Summary: - For most anomaly detection tests,
timestamp_column
is optional. - For
freshness_anomalies
,
timestamp_column
is required and cannot be omitted. If you want to test freshness, you must provide a timestamp column. If your table does not have one, you cannot use the
freshness_anomalies
test as designed [see here](https://docs.elementary-data.com/data-tests/anomaly-detection-tests/freshness-anomalies).