diff --git a/models/sources/src_config_settings.yml b/models/sources/src_config_settings.yml index 7b569fe..9ced5b4 100644 --- a/models/sources/src_config_settings.yml +++ b/models/sources/src_config_settings.yml @@ -9,7 +9,7 @@ sources: tests: - dbt_utils.recency: datepart: hour - field: closed_at + field: cast(closed_at as datetime) interval: 12 config: severity: warn @@ -22,8 +22,8 @@ sources: - last_modified_ledger - ledger_entry_change config: - where: closed_at >= datetime_trunc(datetime_sub(current_timestamp(), interval 2 day), day) - and closed_at < datetime_trunc(current_timestamp(), day) + where: 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: config_setting_id, last_modified_ledger, and ledger_entry_change." diff --git a/models/sources/src_contract_code.yml b/models/sources/src_contract_code.yml index e729712..181430a 100644 --- a/models/sources/src_contract_code.yml +++ b/models/sources/src_contract_code.yml @@ -9,7 +9,7 @@ sources: tests: - dbt_utils.recency: datepart: hour - field: closed_at + field: cast(closed_at as datetime) interval: 12 config: severity: warn @@ -23,8 +23,8 @@ sources: - last_modified_ledger - ledger_entry_change config: - where: closed_at >= datetime_trunc(datetime_sub(current_timestamp(), interval 2 day), day) - and closed_at < datetime_trunc(current_timestamp(), day) + where: 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: contract_code_hash, contract_code_ext_v, last_modified_ledger, and ledger_entry_change." diff --git a/models/sources/src_contract_data.yml b/models/sources/src_contract_data.yml index 695cc08..70b6708 100644 --- a/models/sources/src_contract_data.yml +++ b/models/sources/src_contract_data.yml @@ -9,26 +9,13 @@ sources: tests: - dbt_utils.recency: datepart: hour - field: closed_at + field: cast(closed_at as datetime) interval: 12 config: severity: warn meta: description: "Monitors the freshness of your table over time, as the expected time between data updates." - - dbt_utils.unique_combination_of_columns: - combination_of_columns: - - contract_id - - contract_key_type - - contract_durability - - last_modified_ledger - - ledger_entry_change - config: - where: closed_at >= datetime_trunc(datetime_sub(current_timestamp(), interval 2 day), day) - and closed_at < datetime_trunc(current_timestamp(), day) - meta: - description: - "Tests the uniqueness combination of: contract_id, contract_key_type, contract_durability, last_modified_ledger, and ledger_entry_change." columns: - name: contract_id description: '{{ doc("contract_id") }}' diff --git a/models/sources/src_history_assets.yml b/models/sources/src_history_assets.yml index afbce76..a127702 100644 --- a/models/sources/src_history_assets.yml +++ b/models/sources/src_history_assets.yml @@ -18,7 +18,7 @@ sources: "Monitors the freshness of your table over time, as the expected time between data updates." columns: - name: assets_id - description: '{{ doc("asset_type") }}' + description: '{{ doc("assets_id") }}' tests: - not_null: config: diff --git a/models/sources/src_history_effects.yml b/models/sources/src_history_effects.yml index 4c21c49..2386b3d 100644 --- a/models/sources/src_history_effects.yml +++ b/models/sources/src_history_effects.yml @@ -9,7 +9,7 @@ sources: tests: - dbt_utils.recency: datepart: hour - field: cast(closed_at as datetime) + field: batch_run_date interval: 12 config: severity: warn @@ -40,21 +40,21 @@ sources: tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: details.liquidity_pool description: '{{ doc("details_liquidity_pool") }}' @@ -307,4 +307,4 @@ sources: tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day \ No newline at end of file + where: batch_run_date > current_datetime - interval 2 day \ No newline at end of file diff --git a/models/sources/src_history_operations.yml b/models/sources/src_history_operations.yml index cce4ea2..2e874f3 100644 --- a/models/sources/src_history_operations.yml +++ b/models/sources/src_history_operations.yml @@ -9,7 +9,7 @@ sources: tests: - dbt_utils.recency: datepart: hour - field: closed_at + field: batch_run_date interval: 12 config: severity: warn @@ -22,18 +22,18 @@ sources: tests: - unique: config: - where: closed_at >= datetime_trunc(datetime_sub(current_timestamp(), interval 2 day), day) - and closed_at < datetime_trunc(current_timestamp(), day) + where: batch_run_date >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) + and batch_run_date < datetime_trunc(current_datetime(), day) - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: source_account description: '{{ doc("source_account") }}' tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: source_account_muxed description: '{{ doc("source_account_muxed") }}' @@ -43,21 +43,21 @@ sources: tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: type description: '{{ doc("type") }}' tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: type_string description: '{{ doc("type_string") }}' tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: details description: '{{ doc("details") }}' @@ -367,21 +367,21 @@ sources: tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: details.asset_balance_changes description: '{{ doc("details_asset_balance_changes") }}' @@ -412,4 +412,4 @@ sources: tests: - not_null: config: - where: closed_at > current_timestamp - interval 2 day + where: batch_run_date > current_datetime - interval 2 day diff --git a/models/sources/src_history_transactions.yml b/models/sources/src_history_transactions.yml index 3a1ce88..af2e13a 100644 --- a/models/sources/src_history_transactions.yml +++ b/models/sources/src_history_transactions.yml @@ -9,7 +9,7 @@ sources: tests: - dbt_utils.recency: datepart: hour - field: closed_at + field: batch_run_date interval: 12 config: severity: warn @@ -22,25 +22,25 @@ sources: tests: - unique: config: - where: closed_at >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) - and closed_at < datetime_trunc(current_datetime(), day) + where: batch_run_date >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) + and batch_run_date < datetime_trunc(current_datetime(), day) - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: transaction_hash description: '{{ doc("transaction_hash") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: ledger_sequence description: '{{ doc("ledger_sequence") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: application_order description: '{{ doc("application_order") }}' @@ -50,42 +50,42 @@ sources: tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: account_sequence description: '{{ doc("account_sequence") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: max_fee description: '{{ doc("max_fee") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: operation_count description: '{{ doc("transaction_operation_count") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: created_at description: '{{ doc("created_at") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: memo_type description: '{{ doc("memo_type") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: memo description: '{{ doc("memo") }}' @@ -95,21 +95,21 @@ sources: tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: successful description: '{{ doc("successful") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: fee_charged description: '{{ doc("fee_charged") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: inner_transaction_hash description: '{{ doc("inner_transaction_hash") }}' @@ -146,56 +146,56 @@ sources: tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: tx_result description: '{{ doc("tx_result") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: tx_meta description: '{{ doc("tx_meta") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: tx_fee_meta description: '{{ doc("tx_fee_meta") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: batch_id description: '{{ doc("batch_id") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: batch_run_date description: '{{ doc("batch_run_date") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: batch_insert_ts description: '{{ doc("batch_insert_ts") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: closed_at description: '{{ doc("closed_at") }}' tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: batch_run_date > current_datetime - interval 2 day - name: refundable_fee description: '{{ doc("refundable_fee") }}' diff --git a/models/sources/src_ttl.yml b/models/sources/src_ttl.yml index 379145d..4b6ffc5 100644 --- a/models/sources/src_ttl.yml +++ b/models/sources/src_ttl.yml @@ -9,7 +9,7 @@ sources: tests: - dbt_utils.recency: datepart: hour - field: closed_at + field: cast(closed_at as datetime) interval: 12 config: severity: warn @@ -23,8 +23,8 @@ sources: - last_modified_ledger - ledger_entry_change config: - where: closed_at >= datetime_trunc(datetime_sub(current_datetime(), interval 2 day), day) - and closed_at < datetime_trunc(current_datetime(), day) + where: 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: key_hash, live_until_ledger_seq, last_modified_ledger, and ledger_entry_change." @@ -34,60 +34,60 @@ sources: tests: - not_null: config: - where: closed_at > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: live_until_ledger_seq description: '{{ doc("live_until_ledger_seq") }}' tests: - not_null: config: - where: closed_at > 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: closed_at > 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: closed_at > current_datetime - interval 2 day + where: closed_at > current_timestamp - interval 2 day - name: deleted description: '{{ doc("deleted") }}' tests: - not_null: config: - where: closed_at > 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: closed_at > 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: closed_at > 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: closed_at > 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_datetime - interval 2 day \ No newline at end of file + where: closed_at > current_timestamp - interval 2 day \ No newline at end of file