-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Type-II Dimensional Models and the corresponding yml files with…
… tests for the Soroban Contract tables
- Loading branch information
1 parent
f40c4e4
commit 225f74a
Showing
24 changed files
with
1,157 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: int_incr_contract_code | ||
description: "This intermediate model handles the incremental loading of contract code data from the staging layer." | ||
meta: | ||
owner: "Data Team" | ||
update_schedule: "daily" | ||
description: "Incremental model for contract code with daily updates" | ||
tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- ledger_key_hash | ||
- closed_at | ||
meta: | ||
description: "Tests the uniqueness combination of contract code tracking fields" | ||
columns: | ||
- name: ledger_key_hash | ||
description: '{{ doc("ledger_key_hash") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: contract_code_hash | ||
description: '{{ doc("contract_code_hash") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: last_modified_ledger | ||
description: '{{ doc("last_modified_ledger") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: ledger_entry_change | ||
description: '{{ doc("ledger_entry_change") }}' | ||
tests: | ||
- not_null | ||
- incremental_accepted_values: | ||
values: [0, 1, 2] | ||
|
||
- name: ledger_sequence | ||
description: '{{ doc("ledger_sequence") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: deleted | ||
description: '{{ doc("deleted") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: closed_at | ||
description: '{{ doc("closed_at") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: n_instructions | ||
description: '{{ doc("n_instructions") }}' | ||
|
||
- name: n_functions | ||
description: '{{ doc("n_functions") }}' | ||
|
||
- name: n_globals | ||
description: '{{ doc("n_globals") }}' | ||
|
||
- name: n_table_entries | ||
description: '{{ doc("n_table_entries") }}' | ||
|
||
- name: n_types | ||
description: '{{ doc("n_types") }}' | ||
|
||
- name: n_data_segments | ||
description: '{{ doc("n_data_segments") }}' | ||
|
||
- name: n_elem_segments | ||
description: '{{ doc("n_elem_segments") }}' | ||
|
||
- name: n_imports | ||
description: '{{ doc("n_imports") }}' | ||
|
||
- name: n_exports | ||
description: '{{ doc("n_exports") }}' | ||
|
||
- name: n_data_segment_bytes | ||
description: '{{ doc("n_data_segment_bytes") }}' | ||
|
||
- name: batch_id | ||
description: '{{ doc("batch_id") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: batch_run_date | ||
description: '{{ doc("batch_run_date") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: airflow_start_ts | ||
description: "The timestamp indicating the start of the Airflow task." | ||
tests: | ||
- not_null | ||
|
||
- name: dw_load_ts | ||
description: "The timestamp for when the data was loaded into the data warehouse." | ||
tests: | ||
- not_null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: int_incr_contract_data | ||
description: "This intermediate model handles the incremental loading of contract data from the staging layer." | ||
meta: | ||
owner: "Data Team" | ||
update_schedule: "daily" | ||
description: "Incremental model for contract data with daily updates" | ||
tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- ledger_key_hash | ||
- closed_at | ||
meta: | ||
description: "Tests the uniqueness combination of contract data tracking fields" | ||
|
||
columns: | ||
- name: ledger_key_hash | ||
description: '{{ doc("ledger_key_hash") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: contract_id | ||
description: '{{ doc("contract_id") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: contract_key_type | ||
description: '{{ doc("contract_key_type") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: contract_durability | ||
description: '{{ doc("contract_durability") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: last_modified_ledger | ||
description: '{{ doc("last_modified_ledger") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: ledger_entry_change | ||
description: '{{ doc("ledger_entry_change") }}' | ||
tests: | ||
- not_null | ||
- incremental_accepted_values: | ||
values: [0, 1, 2] | ||
|
||
- name: ledger_sequence | ||
description: '{{ doc("ledger_sequence") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: asset_code | ||
description: '{{ doc("asset_code") }}' | ||
|
||
- name: asset_issuer | ||
description: '{{ doc("asset_issuer") }}' | ||
|
||
- name: asset_type | ||
description: '{{ doc("asset_type") }}' | ||
|
||
- name: balance_holder | ||
description: '{{ doc("balance_holder") }}' | ||
|
||
- name: balance | ||
description: '{{ doc("balance") }}' | ||
|
||
- name: deleted | ||
description: '{{ doc("deleted") }}' | ||
|
||
- name: closed_at | ||
description: '{{ doc("closed_at") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: batch_insert_ts | ||
description: '{{ doc("batch_insert_ts") }}' | ||
|
||
- name: batch_id | ||
description: '{{ doc("batch_id") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: batch_run_date | ||
description: '{{ doc("batch_run_date") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: airflow_start_ts | ||
description: "The timestamp indicating the start of the Airflow task." | ||
tests: | ||
- not_null | ||
|
||
- name: dw_load_ts | ||
description: "Timestamp when the record was loaded." | ||
tests: | ||
- not_null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: int_incr_ttl | ||
description: | | ||
This intermediate model handles the incremental loading of ledger time-to-live (TTL) | ||
data from the staging layer. It processes only new or updated data up to the previous day based on `execution_date`. | ||
meta: | ||
owner: "Data Team" | ||
update_schedule: "daily" | ||
description: "Incremental model for TTL data with daily updates" | ||
tests: | ||
- dbt_utils.unique_combination_of_columns: | ||
combination_of_columns: | ||
- key_hash | ||
- closed_at | ||
meta: | ||
description: "Tests the uniqueness combination of TTL tracking fields" | ||
columns: | ||
- name: key_hash | ||
description: '{{ doc("key_hash") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: live_until_ledger_seq | ||
description: '{{ doc("live_until_ledger_seq") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: last_modified_ledger | ||
description: '{{ doc("last_modified_ledger") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: ledger_entry_change | ||
description: '{{ doc("ledger_entry_change") }}' | ||
tests: | ||
- not_null | ||
- incremental_accepted_values: | ||
values: [0, 1, 2] | ||
|
||
- name: ledger_sequence | ||
description: '{{ doc("ledger_sequence") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: deleted | ||
description: '{{ doc("deleted") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: closed_at | ||
description: '{{ doc("closed_at") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: batch_id | ||
description: '{{ doc("batch_id") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: batch_run_date | ||
description: '{{ doc("batch_run_date") }}' | ||
tests: | ||
- not_null | ||
|
||
- name: airflow_start_ts | ||
description: "The timestamp indicating the start of the Airflow task." | ||
tests: | ||
- not_null | ||
|
||
- name: dw_load_ts | ||
description: "The timestamp for when the data was loaded into the data warehouse." | ||
tests: | ||
- not_null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.