From 4e02dd5040589b69755d4e4d71396253478e8106 Mon Sep 17 00:00:00 2001 From: Simon Chow Date: Mon, 5 Aug 2024 10:15:24 -0400 Subject: [PATCH] Updates to use closed_at instead of batch_run_date --- .../account_signers_current.sql | 10 +--- .../ledger_current_state/accounts_current.sql | 10 +--- .../claimable_balances_current.sql | 5 +- .../claimable_balances_current.yml | 32 +++++------ .../config_settings_current.sql | 5 +- .../contract_code_current.sql | 5 +- .../contract_data_current.sql | 5 +- .../liquidity_pools_current.sql | 10 +--- .../ledger_current_state/offers_current.sql | 10 +--- .../trust_lines_current.sql | 10 +--- .../ledger_current_state/ttl_current.sql | 5 +- models/sources/src_accounts.yml | 57 +++++++++++-------- models/sources/src_accounts_signers.yml | 25 +++++--- models/sources/src_claimable_balances.yml | 41 +++++++------ models/sources/src_history_effects.yml | 16 +++--- models/sources/src_history_operations.yml | 22 +++---- models/sources/src_history_transactions.yml | 44 +++++++------- models/sources/src_liquidity_pools.yml | 53 +++++++++-------- models/sources/src_offers.yml | 48 ++++++++-------- models/sources/src_trust_lines.yml | 42 +++++++------- 20 files changed, 221 insertions(+), 234 deletions(-) diff --git a/models/marts/ledger_current_state/account_signers_current.sql b/models/marts/ledger_current_state/account_signers_current.sql index 8f2f161..9c54b27 100644 --- a/models/marts/ledger_current_state/account_signers_current.sql +++ b/models/marts/ledger_current_state/account_signers_current.sql @@ -19,7 +19,7 @@ with , s.weight , s.sponsor , s.last_modified_ledger - , l.closed_at + , s.closed_at , s.ledger_entry_change , s.deleted -- table only has natural keys, creating a primary key @@ -33,16 +33,10 @@ with order by s.last_modified_ledger desc, s.ledger_entry_change desc ) as row_nr from {{ ref('stg_account_signers') }} as s - join {{ ref('stg_history_ledgers') }} as l - on s.last_modified_ledger = l.sequence - {% if is_incremental() %} -- limit the number of partitions fetched where - s.batch_run_date >= date_sub(current_date(), interval 30 day) - -- fetch the last week of records loaded - and timestamp_add(s.batch_insert_ts, interval 7 day) - > (select max(t.upstream_insert_ts) from {{ this }} as t) + s.closed_at >= timestamp_sub(current_timestamp(), interval 7 day) {% endif %} ) select diff --git a/models/marts/ledger_current_state/accounts_current.sql b/models/marts/ledger_current_state/accounts_current.sql index 2a8d11a..7c3b27b 100644 --- a/models/marts/ledger_current_state/accounts_current.sql +++ b/models/marts/ledger_current_state/accounts_current.sql @@ -31,7 +31,7 @@ with , a.threshold_high , a.last_modified_ledger , a.ledger_entry_change - , l.closed_at + , a.closed_at , a.deleted , a.sponsor , a.sequence_ledger @@ -47,16 +47,10 @@ with ) as row_nr from {{ ref('stg_accounts') }} as a - join {{ ref('stg_history_ledgers') }} as l - on a.last_modified_ledger = l.sequence - {% if is_incremental() %} -- limit the number of partitions fetched where - a.batch_run_date >= date_sub(current_date(), interval 30 day) - -- fetch the last week of records loaded - and timestamp_add(a.batch_insert_ts, interval 7 day) - > (select max(t.upstream_insert_ts) from {{ this }} as t) + a.closed_at >= timestamp_sub(current_timestamp(), interval 7 day) {% endif %} ) diff --git a/models/marts/ledger_current_state/claimable_balances_current.sql b/models/marts/ledger_current_state/claimable_balances_current.sql index c188215..4475fe3 100644 --- a/models/marts/ledger_current_state/claimable_balances_current.sql +++ b/models/marts/ledger_current_state/claimable_balances_current.sql @@ -2,7 +2,8 @@ config( tags = ["current_state"], materialized = "incremental", - unique_key = "balance_id" + unique_key = "balance_id", + cluster_by = "balance_id" ) }} /* Returns the latest state of each claimable balance in the `claimable_balances` table. @@ -37,7 +38,7 @@ with {% if is_incremental() %} -- limit the number of partitions fetched incrementally where - cb.batch_run_date >= date_sub(current_date(), interval 2 day) + cb.closed_at >= timestamp_sub(current_timestamp(), interval 2 day) {% endif %} ) diff --git a/models/marts/ledger_current_state/claimable_balances_current.yml b/models/marts/ledger_current_state/claimable_balances_current.yml index 0aa123b..e89b036 100644 --- a/models/marts/ledger_current_state/claimable_balances_current.yml +++ b/models/marts/ledger_current_state/claimable_balances_current.yml @@ -18,7 +18,7 @@ models: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: claimants description: '{{ doc("claimants") }}' @@ -28,7 +28,7 @@ models: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: asset_code description: '{{ doc("asset_code") }}' @@ -36,7 +36,7 @@ models: - not_null: config: where: asset_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: asset_issuer description: '{{ doc("asset_issuer") }}' @@ -44,42 +44,42 @@ models: - not_null: config: where: asset_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: asset_amount description: '{{ doc("asset_amount") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: sponsor description: '{{ doc("sponsor") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: flags description: '{{ doc("flags_accounts_balances") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: last_modified_ledger description: '{{ doc("last_modified_ledger") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: ledger_entry_change description: '{{ doc("ledger_entry_change") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - accepted_values: values: [0, 1, 2] quote: false @@ -89,46 +89,46 @@ models: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_id description: '{{ doc("batch_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: closed_at description: '{{ doc("closed_at") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: ledger_sequence description: '{{ doc("ledger_sequence") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: upstream_insert_ts description: '{{ doc("upstream_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day diff --git a/models/marts/ledger_current_state/config_settings_current.sql b/models/marts/ledger_current_state/config_settings_current.sql index 938528b..e7827a1 100644 --- a/models/marts/ledger_current_state/config_settings_current.sql +++ b/models/marts/ledger_current_state/config_settings_current.sql @@ -72,10 +72,7 @@ with {% if is_incremental() %} -- limit the number of partitions fetched incrementally where - cfg.closed_at >= timestamp_sub(current_timestamp(), interval 30 day) - -- fetch the last week of records loaded - and timestamp_add(cfg.batch_insert_ts, interval 7 day) - > (select max(t.upstream_insert_ts) from {{ this }} as t) + cfg.closed_at >= timestamp_sub(current_timestamp(), interval 7 day) {% endif %} ) diff --git a/models/marts/ledger_current_state/contract_code_current.sql b/models/marts/ledger_current_state/contract_code_current.sql index 4b64eb3..d5fd961 100644 --- a/models/marts/ledger_current_state/contract_code_current.sql +++ b/models/marts/ledger_current_state/contract_code_current.sql @@ -33,10 +33,7 @@ with {% if is_incremental() %} -- limit the number of partitions fetched incrementally where - cc.closed_at >= timestamp_sub(current_timestamp(), interval 30 day) - -- fetch the last week of records loaded - and timestamp_add(cc.batch_insert_ts, interval 7 day) - > (select max(t.upstream_insert_ts) from {{ this }} as t) + cc.closed_at >= timestamp_sub(current_timestamp(), interval 7 day) {% endif %} ) diff --git a/models/marts/ledger_current_state/contract_data_current.sql b/models/marts/ledger_current_state/contract_data_current.sql index b5f5b94..05ba040 100644 --- a/models/marts/ledger_current_state/contract_data_current.sql +++ b/models/marts/ledger_current_state/contract_data_current.sql @@ -40,10 +40,7 @@ with {% if is_incremental() %} -- limit the number of partitions fetched incrementally where - cd.closed_at >= timestamp_sub(current_timestamp(), interval 30 day) - -- fetch the last week of records loaded - and timestamp_add(cd.batch_insert_ts, interval 7 day) - > (select max(t.upstream_insert_ts) from {{ this }} as t) + cd.closed_at >= timestamp_sub(current_timestamp(), interval 7 day) {% endif %} ) diff --git a/models/marts/ledger_current_state/liquidity_pools_current.sql b/models/marts/ledger_current_state/liquidity_pools_current.sql index 741beec..7618a02 100644 --- a/models/marts/ledger_current_state/liquidity_pools_current.sql +++ b/models/marts/ledger_current_state/liquidity_pools_current.sql @@ -33,7 +33,7 @@ with , lp.asset_b_amount , lp.last_modified_ledger , lp.ledger_entry_change - , l.closed_at + , lp.closed_at , lp.deleted , lp.batch_run_date , lp.batch_insert_ts @@ -43,16 +43,10 @@ with order by lp.last_modified_ledger desc, lp.ledger_entry_change desc ) as row_nr from {{ ref('stg_liquidity_pools') }} as lp - join {{ ref('stg_history_ledgers') }} as l - on lp.last_modified_ledger = l.sequence - {% if is_incremental() %} -- limit the number of partitions fetched where - lp.batch_run_date >= date_sub(current_date(), interval 30 day) - -- fetch the last week of records loaded - and timestamp_add(lp.batch_insert_ts, interval 7 day) - > (select max(t.upstream_insert_ts) from {{ this }} as t) + lp.closed_at >= timestamp_sub(current_timestamp(), interval 7 day) {% endif %} ) diff --git a/models/marts/ledger_current_state/offers_current.sql b/models/marts/ledger_current_state/offers_current.sql index 69ad2b8..0cce950 100644 --- a/models/marts/ledger_current_state/offers_current.sql +++ b/models/marts/ledger_current_state/offers_current.sql @@ -25,7 +25,7 @@ with , o.price , o.flags , o.last_modified_ledger - , l.closed_at + , o.closed_at , o.ledger_entry_change , o.deleted , o.sponsor @@ -37,16 +37,10 @@ with order by o.last_modified_ledger desc, o.ledger_entry_change desc ) as row_nr from {{ ref('stg_offers') }} as o - join {{ ref('stg_history_ledgers') }} as l - on o.last_modified_ledger = l.sequence - {% if is_incremental() %} -- limit the number of partitions fetched where - o.batch_run_date >= date_sub(current_date(), interval 30 day) - -- fetch the last week of records loaded - and timestamp_add(o.batch_insert_ts, interval 7 day) - > (select max(t.upstream_insert_ts) from {{ this }} as t) + o.closed_at >= timestamp_sub(current_timestamp(), interval 7 day) {% endif %} ) diff --git a/models/marts/ledger_current_state/trust_lines_current.sql b/models/marts/ledger_current_state/trust_lines_current.sql index 3dad927..6cd338d 100644 --- a/models/marts/ledger_current_state/trust_lines_current.sql +++ b/models/marts/ledger_current_state/trust_lines_current.sql @@ -27,7 +27,7 @@ with , tl.trust_line_limit , tl.last_modified_ledger , tl.ledger_entry_change - , l.closed_at + , tl.closed_at , tl.deleted -- table only has natural keys, creating a primary key , concat(tl.account_id, '-', tl.asset_code, '-', tl.asset_issuer, '-', tl.liquidity_pool_id @@ -40,16 +40,10 @@ with order by tl.last_modified_ledger desc, tl.ledger_entry_change desc ) as row_nr from {{ ref('stg_trust_lines') }} as tl - join {{ ref('stg_history_ledgers') }} as l - on tl.last_modified_ledger = l.sequence - {% if is_incremental() %} -- limit the number of partitions fetched incrementally where - tl.batch_run_date >= date_sub(current_date(), interval 30 day) - -- fetch the last week of records loaded - and timestamp_add(tl.batch_insert_ts, interval 7 day) - > (select max(t.upstream_insert_ts) from {{ this }} as t) + tl.closed_at >= timestamp_sub(current_timestamp(), interval 7 day) {% endif %} ) diff --git a/models/marts/ledger_current_state/ttl_current.sql b/models/marts/ledger_current_state/ttl_current.sql index 38d4123..e1528ad 100644 --- a/models/marts/ledger_current_state/ttl_current.sql +++ b/models/marts/ledger_current_state/ttl_current.sql @@ -31,10 +31,7 @@ with {% if is_incremental() %} -- limit the number of partitions fetched incrementally where - ttl.closed_at >= timestamp_sub(current_timestamp(), interval 30 day) - -- fetch the last week of records loaded - and timestamp_add(ttl.batch_insert_ts, interval 7 day) - > (select max(t.upstream_insert_ts) from {{ this }} as t) + ttl.closed_at >= timestamp_sub(current_timestamp(), interval 7 day) {% endif %} ) diff --git a/models/sources/src_accounts.yml b/models/sources/src_accounts.yml index 6fc65e0..ccd554f 100644 --- a/models/sources/src_accounts.yml +++ b/models/sources/src_accounts.yml @@ -19,8 +19,8 @@ sources: - last_modified_ledger config: where: - batch_run_date >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) - and batch_run_date < datetime_trunc(current_datetime(), day) + closed_at >= timestamp_trunc(timestamp_sub(current_timestamp(), interval 2 day), day) + and closed_at < timestamp_trunc(current_timestamp(), day) meta: description: "Tests the uniqueness combination of: account_id, sequence_number, ledger_entry_change and last_modified_ledger." columns: @@ -29,105 +29,105 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: balance description: '{{ doc("balance") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: buying_liabilities description: '{{ doc("buying_liabilities") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: selling_liabilities description: '{{ doc("selling_liabilities") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: sequence_number description: '{{ doc("sequence_number") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: num_subentries description: '{{ doc("num_subentries") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: inflation_destination description: '{{ doc("inflation_destination") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: flags description: '{{ doc("flags_accounts_balances") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: home_domain description: '{{ doc("home_domain") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: master_weight description: '{{ doc("master_weight") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: threshold_low description: '{{ doc("threshold_low") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: threshold_medium description: '{{ doc("threshold_medium") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: threshold_high description: '{{ doc("threshold_high") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: last_modified_ledger description: '{{ doc("last_modified_ledger") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: ledger_entry_change description: '{{ doc("ledger_entry_change") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - accepted_values: values: [0, 1, 2] quote: false @@ -137,7 +137,7 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: sponsor description: '{{ doc("sponsor") }}' @@ -147,46 +147,53 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: num_sponsoring description: '{{ doc("num_sponsoring") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: sequence_ledger description: '{{ doc("sequence_ledger") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: sequence_time description: '{{ doc("sequence_time") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_id description: '{{ doc("batch_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day + + - name: closed_at + description: '{{ doc("closed_at") }}' + tests: + - not_null: + config: + where: closed_at > current_timestamp - interval 2 day diff --git a/models/sources/src_accounts_signers.yml b/models/sources/src_accounts_signers.yml index a4e2710..56391fc 100644 --- a/models/sources/src_accounts_signers.yml +++ b/models/sources/src_accounts_signers.yml @@ -19,8 +19,8 @@ sources: - last_modified_ledger config: where: - batch_run_date >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) - and batch_run_date < datetime_trunc(current_datetime(), day) + closed_at >= timestamp_trunc(timestamp_sub(current_timestamp(), interval 2 day), day) + and closed_at < timestamp_trunc(current_timestamp(), day) meta: description: "Tests the uniqueness combination of: account_id, signer, ledger_entry_change and last_modified_ledger." columns: @@ -29,21 +29,21 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: signer description: '{{ doc("signer") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: weight description: '{{ doc("weight") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: sponsor description: '{{ doc("sponsor") }}' @@ -53,25 +53,32 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_id description: '{{ doc("batch_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day + + - name: closed_at + description: '{{ doc("closed_at") }}' + tests: + - not_null: + config: + where: closed_at > current_timestamp - interval 2 day diff --git a/models/sources/src_claimable_balances.yml b/models/sources/src_claimable_balances.yml index cd9fc7f..e6cebf1 100644 --- a/models/sources/src_claimable_balances.yml +++ b/models/sources/src_claimable_balances.yml @@ -17,8 +17,8 @@ sources: - ledger_entry_change config: where: - batch_run_date >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) - and batch_run_date < datetime_trunc(current_datetime(), day) + closed_at >= timestamp_trunc(timestamp_sub(current_timestamp(), interval 2 day), day) + and closed_at < timestamp_trunc(current_timestamp(), day) meta: description: "Tests the uniqueness combination of: balance_id and ledger_entry_change." @@ -28,7 +28,7 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: claimants description: '{{ doc("claimants") }}' @@ -56,7 +56,7 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: asset_code description: '{{ doc("asset_code") }}' @@ -64,7 +64,7 @@ sources: - not_null: config: where: asset_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: asset_issuer description: '{{ doc("asset_issuer") }}' @@ -72,42 +72,42 @@ sources: - not_null: config: where: asset_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: asset_amount description: '{{ doc("asset_amount") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: sponsor description: '{{ doc("sponsor") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: flags description: '{{ doc("flags_accounts_balances") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: last_modified_ledger description: '{{ doc("last_modified_ledger") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: ledger_entry_change description: '{{ doc("ledger_entry_change") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - accepted_values: values: [0, 1, 2] quote: false @@ -117,32 +117,39 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_id description: '{{ doc("batch_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - - name: batch_run_date + - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: asset_id description: '{{ doc("asset_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day + + - name: closed_at + description: '{{ doc("closed_at") }}' + tests: + - not_null: + config: + where: closed_at > current_timestamp - interval 2 day \ No newline at end of file diff --git a/models/sources/src_history_effects.yml b/models/sources/src_history_effects.yml index 2ff8f2c..781e47b 100644 --- a/models/sources/src_history_effects.yml +++ b/models/sources/src_history_effects.yml @@ -17,7 +17,7 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: address_muxed description: '{{ doc("address_muxed") }}' @@ -27,21 +27,21 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: type description: '{{ doc("type") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: type_string description: '{{ doc("type_string") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: details description: '{{ doc("details_effects") }}' @@ -51,21 +51,21 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: details.liquidity_pool description: '{{ doc("details_liquidity_pool") }}' @@ -318,4 +318,4 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day diff --git a/models/sources/src_history_operations.yml b/models/sources/src_history_operations.yml index f869fb9..958e452 100644 --- a/models/sources/src_history_operations.yml +++ b/models/sources/src_history_operations.yml @@ -18,18 +18,18 @@ sources: - unique: config: where: - batch_run_date >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) - and batch_run_date < datetime_trunc(current_datetime(), day) + closed_at >= timestamp_trunc(timestamp_sub(current_timestamp - interval 2 day + and closed_at < timestamp_trunc(current_timestamp - interval 2 day - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: source_account description: '{{ doc("source_account") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: source_account_muxed description: '{{ doc("source_account_muxed") }}' @@ -39,21 +39,21 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: type description: '{{ doc("type") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: type_string description: '{{ doc("type_string") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: details description: '{{ doc("details") }}' @@ -363,21 +363,21 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: details.asset_balance_changes description: '{{ doc("details_asset_balance_changes") }}' @@ -414,7 +414,7 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: details_json description: '{{ doc("details") }}' diff --git a/models/sources/src_history_transactions.yml b/models/sources/src_history_transactions.yml index ea4b384..754935c 100644 --- a/models/sources/src_history_transactions.yml +++ b/models/sources/src_history_transactions.yml @@ -18,25 +18,25 @@ sources: - unique: config: where: - batch_run_date >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) - and batch_run_date < datetime_trunc(current_datetime(), day) + closed_at >= timestamp_trunc(timestamp_sub(current_timestamp(), interval 2 day), day) + and closed_at < timestamp_trunc(current_timestamp(), day) - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: transaction_hash description: '{{ doc("transaction_hash") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: ledger_sequence description: '{{ doc("ledger_sequence") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: application_order description: '{{ doc("application_order") }}' @@ -46,42 +46,42 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: account_sequence description: '{{ doc("account_sequence") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: max_fee description: '{{ doc("max_fee") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: operation_count description: '{{ doc("transaction_operation_count") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: created_at description: '{{ doc("created_at") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: memo_type description: '{{ doc("memo_type") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: memo description: '{{ doc("memo") }}' @@ -91,21 +91,21 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: successful description: '{{ doc("successful") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: fee_charged description: '{{ doc("fee_charged") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: inner_transaction_hash description: '{{ doc("inner_transaction_hash") }}' @@ -142,56 +142,56 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: tx_result description: '{{ doc("tx_result") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: tx_meta description: '{{ doc("tx_meta") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: tx_fee_meta description: '{{ doc("tx_fee_meta") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_id description: '{{ doc("batch_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: closed_at description: '{{ doc("closed_at") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: resource_fee description: '{{ doc("resource_fee") }}' diff --git a/models/sources/src_liquidity_pools.yml b/models/sources/src_liquidity_pools.yml index 7747981..547af23 100644 --- a/models/sources/src_liquidity_pools.yml +++ b/models/sources/src_liquidity_pools.yml @@ -18,8 +18,8 @@ sources: - last_modified_ledger config: where: - batch_run_date >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) - and batch_run_date < datetime_trunc(current_datetime(), day) + closed_at >= timestamp_trunc(timestamp_sub(current_timestamp(), interval 2 day), day) + and closed_at < timestamp_trunc(current_timestamp(), day) meta: description: "Tests the uniqueness combination of: liquidity_pool_id, ledger_entry_change and last_modified_ledger." columns: @@ -28,49 +28,49 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: type description: '{{ doc("pool_type") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: fee description: '{{ doc("fee") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: trustline_count description: '{{ doc("trustline_count") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: pool_share_count description: '{{ doc("pool_share_count") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: asset_a_id description: '{{ doc("asset_a_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: asset_a_type description: '{{ doc("asset_a_type") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: asset_a_code description: '{{ doc("asset_a_code") }}' @@ -78,7 +78,7 @@ sources: - not_null: config: where: asset_a_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: asset_a_issuer description: '{{ doc("asset_a_issuer") }}' @@ -86,28 +86,28 @@ sources: - not_null: config: where: asset_a_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: asset_a_amount description: '{{ doc("asset_a_amount") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: asset_b_id description: '{{ doc("asset_b_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: asset_b_type description: '{{ doc("asset_a_type") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: asset_b_code description: '{{ doc("asset_a_code") }}' @@ -115,7 +115,7 @@ sources: - not_null: config: where: asset_b_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: asset_b_issuer description: '{{ doc("asset_a_issuer") }}' @@ -123,28 +123,28 @@ sources: - not_null: config: where: asset_b_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: asset_b_amount description: '{{ doc("asset_a_amount") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: last_modified_ledger description: '{{ doc("last_modified_ledger") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: ledger_entry_change description: '{{ doc("ledger_entry_change") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - accepted_values: values: [0, 1, 2] quote: false @@ -154,25 +154,32 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_id description: '{{ doc("batch_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day + + - name: closed_at + description: '{{ doc("closed_at") }}' + tests: + - not_null: + config: + where: closed_at > current_timestamp - interval 2 day diff --git a/models/sources/src_offers.yml b/models/sources/src_offers.yml index a5323cf..a177577 100644 --- a/models/sources/src_offers.yml +++ b/models/sources/src_offers.yml @@ -18,8 +18,8 @@ sources: - last_modified_ledger config: where: - batch_run_date >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) - and batch_run_date < datetime_trunc(current_datetime(), day) + closed_at >= timestamp_trunc(timestamp_sub(current_timestamp(), interval 2 day), day) + and closed_at < timestamp_trunc(current_timestamp(), day) meta: description: "Tests the uniqueness combination of: offer_id, ledger_entry_change and last_modified_ledger." columns: @@ -28,21 +28,21 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: offer_id description: '{{ doc("offer_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: selling_asset_type description: '{{ doc("asset_type") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: selling_asset_code description: '{{ doc("asset_code") }}' @@ -50,7 +50,7 @@ sources: - not_null: config: where: selling_asset_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: selling_asset_issuer description: '{{ doc("asset_issuer") }}' @@ -58,14 +58,14 @@ sources: - not_null: config: where: selling_asset_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: buying_asset_type description: '{{ doc("asset_type") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: buying_asset_code description: '{{ doc("asset_code") }}' @@ -73,7 +73,7 @@ sources: - not_null: config: where: buying_asset_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: buying_asset_issuer description: '{{ doc("asset_issuer") }}' @@ -81,56 +81,56 @@ sources: - not_null: config: where: buying_asset_type != 'native' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: amount description: '{{ doc("amount") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: pricen description: '{{ doc("price_n") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: priced description: '{{ doc("price_d") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: price description: '{{ doc("price") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: flags description: '{{ doc("flags_offers") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: last_modified_ledger description: '{{ doc("last_modified_ledger") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: ledger_entry_change description: '{{ doc("ledger_entry_change") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - accepted_values: values: [0, 1, 2] quote: false @@ -140,7 +140,7 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: sponsor description: '{{ doc("sponsor") }}' @@ -150,42 +150,42 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: selling_asset_id description: '{{ doc("assets_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: buying_asset_id description: '{{ doc("assets_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: closed_at description: '{{ doc("closed_at") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: ledger_sequence description: '{{ doc("ledger_sequence") }}' diff --git a/models/sources/src_trust_lines.yml b/models/sources/src_trust_lines.yml index 8e51a46..600d55b 100644 --- a/models/sources/src_trust_lines.yml +++ b/models/sources/src_trust_lines.yml @@ -21,8 +21,8 @@ sources: - last_modified_ledger config: where: - batch_run_date >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) - and batch_run_date < datetime_trunc(current_datetime(), day) + closed_at >= timestamp_trunc(timestamp_sub(current_timestamp(), interval 2 day), day) + and closed_at < timestamp_trunc(current_timestamp(), day) meta: description: "Tests the uniqueness combination of: account_id, asset_code, asset_issuer, liquidity_pool_id, ledger_entry_change and last_modified_ledger." columns: @@ -31,21 +31,21 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: account_id description: '{{ doc("account_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: asset_type description: '{{ doc("asset_type") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - accepted_values: values: ["credit_alphanum4", "credit_alphanum12", "pool_share"] @@ -56,7 +56,7 @@ sources: - not_null: config: where: asset_type != 'pool_share' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: asset_code description: '{{ doc("asset_code") }}' @@ -64,63 +64,63 @@ sources: - not_null: config: where: asset_type != 'pool_share' - and batch_run_date > current_datetime - interval 2 day + and closed_at > current_timestamp - interval 2 day - name: liquidity_pool_id description: '{{ doc("liquidity_pool_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: balance description: '{{ doc("trust_balance") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: trust_line_limit description: '{{ doc("trust_line_limit") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: buying_liabilities description: '{{ doc("buying_liabilities") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: selling_liabilities description: '{{ doc("selling_liabilities") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: flags description: '{{ doc("flags_trust_lines") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: last_modified_ledger description: '{{ doc("last_modified_ledger") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: ledger_entry_change description: '{{ doc("ledger_entry_change") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - accepted_values: values: [0, 1, 2] quote: false @@ -130,28 +130,28 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_id description: '{{ doc("batch_id") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: sponsor description: '{{ doc("sponsor") }}' @@ -161,14 +161,14 @@ sources: tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: closed_at description: '{{ doc("closed_at") }}' tests: - not_null: config: - where: batch_run_date > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: ledger_sequence description: '{{ doc("ledger_sequence") }}'