Revert "removing recency test that frequently fails"

This reverts commit 1651e0e8e6.
This commit is contained in:
Mike Stepanovic 2025-01-17 08:36:15 -07:00
parent 1651e0e8e6
commit 6eff123a9d
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,27 @@
{{ config (
materialized = 'view',
tags = ['recent_test']
) }}
WITH last_3_days AS (
SELECT
block_date
FROM
{{ ref("_max_block_by_date") }}
qualify ROW_NUMBER() over (
ORDER BY
block_date DESC
) = 3
)
SELECT
*
FROM
{{ ref('defi__fact_liquidity_pool_actions') }}
WHERE
block_timestamp :: DATE >= (
SELECT
block_date
FROM
last_3_days
)

View File

@ -0,0 +1,24 @@
version: 2
models:
- name: test_defi__liquidity_actions_recent
description: Records of all liquidity pool actions on Aleo.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- TX_ID
- LIQUIDITY_POOL_PROTOCOL
- LIQUIDITY_PROVIDER
- TOKEN1_ID
- TOKEN2_ID
columns:
- name: BLOCK_TIMESTAMP
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: hour
interval: 3
- name: BLOCK_ID
tests:
- not_null