DBT Test: Dbt Expectations Expect Row Values To Have Recent Data S3 Access Log Events Request Time Day 2
DBT test name: dbt_expectations_expect_row_values_to_have_recent_data_s3_access_log_events_request_time__day__2
DBT details
-
Kind:
generic(expect_row_values_to_have_recent_data) -
Column under test:
request_time -
Test file: trase/data_pipeline/models/s3_monitoring/_schema_s3_monitoring.yml
Description
No description
Details
{{ dbt_expectations.test_expect_row_values_to_have_recent_data(**_dbt_generic_test_kwargs) }}{{ config(severity="warn",alias="dbt_expectations_expect_row_va_daa8ac274706b58b5c4996d6ece2fdd0") }}
with max_recency as (
select max(cast(request_time as timestamp)) as max_timestamp
from
"trase_ducklake"."main_s3_monitoring"."s3_access_log_events"
where
-- to exclude erroneous future dates
cast(request_time as timestamp) <= cast(
cast(now() as timestamp)
at time zone 'UTC' at time zone 'UTC'
as timestamp
)
)
select
*
from
max_recency
where
-- if the row_condition excludes all rows, we need to compare against a default date
-- to avoid false negatives
coalesce(max_timestamp, cast('1970-01-01' as timestamp))
<
cast(
(cast(
cast(now() as timestamp)
at time zone 'UTC' at time zone 'UTC'
as timestamp
) + cast(-2 as bigint) * interval 1 day) as timestamp)