solana-models/models/silver/parser/silver__decoded_instructions.yml
desmond-hui f8b8420a25
add test to ensure all data in decoded makes it into the combined table (#521)
* add test to ensure all data in decoded makes it into the combined table

* fix name
2024-04-10 06:39:08 -07:00

44 lines
1.6 KiB
YAML

version: 2
models:
- name: silver__decoded_instructions
columns:
- name: BLOCK_TIMESTAMP
description: "{{ doc('block_timestamp') }}"
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 1
- name: BLOCK_ID
description: "{{ doc('block_id') }}"
tests:
- not_null
- name: TX_ID
description: "{{ doc('tx_id') }}"
tests:
- not_null
- name: INDEX
description: "{{ doc('event_index') }}"
tests:
- not_null
- name: INNER_INDEX
description: "{{ doc('inner_index') }}"
- name: PROGRAM_ID
description: "{{ doc('program_id') }}"
- name: DECODED_INSTRUCTION
description: An instruction specifies which program it is calling, which accounts it wants to read or modify, and additional data that serves as auxiliary input to the program
tests:
- not_null:
where: block_timestamp::date > current_date - 30
- name: _INSERTED_TIMESTAMP
description: "{{ doc('_inserted_timestamp') }}"
tests:
- not_null
- name: DECODED_INSTRUCTIONS_ID
description: Surrogate key
tests:
- dbt_utils.relationships_where:
to: ref('silver__decoded_instructions_combined')
field: decoded_instructions_combined_id
from_condition: _inserted_timestamp >= current_date - 7
to_condition: _inserted_timestamp >= current_date - 7