fix inc
Some checks failed
docs_update / docs_update (push) Has been cancelled
docs_update / notify-failure (push) Has been cancelled
dbt_test_monthly / run_dbt_jobs (push) Has been cancelled
dbt_test_monthly / notify-failure (push) Has been cancelled

This commit is contained in:
Eric Laurello 2025-08-06 12:43:32 -04:00
parent aa7b71b2c5
commit 0f91c93c3f

View File

@ -8,8 +8,30 @@
tags = ['noncore']
) }}
WITH base AS (
{% if execute %}
{% if is_incremental() %}
{% set min_bts_query %}
SELECT
MIN(block_timestamp) :: DATE
FROM
{{ ref('silver__nft_mints_v2') }}
WHERE
_inserted_timestamp > (
SELECT
MAX(_inserted_timestamp) modified_timestamp
FROM
{{ this }}
) {% endset %}
{% set min_bts = run_query(min_bts_query) [0] [0] %}
{% if not min_bts or min_bts == 'None' %}
{% set min_bts = '2099-01-01' %}
{% endif %}
{% endif %}
{% endif %}
WITH base AS (
SELECT
*
FROM
@ -69,12 +91,7 @@ WHERE
success
{% if is_incremental() %}
AND _inserted_timestamp >= (
SELECT
MAX(_inserted_timestamp)
FROM
{{ this }}
)
AND block_timestamp :: DATE >= '{{ min_bts }}'
{% endif %}
)
SELECT