test columns

This commit is contained in:
drethereum 2024-07-16 13:13:15 -06:00
parent e54ec7a497
commit 99fb60cfae
10 changed files with 67 additions and 46 deletions

View File

@ -4,7 +4,8 @@ models:
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- _LOG_ID
- TX_HASH
- EVENT_INDEX
- fsc_utils.sequence_gaps:
partition_by:
- BLOCK_NUMBER

View File

@ -4,7 +4,8 @@ models:
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- _LOG_ID
- TX_HASH
- EVENT_INDEX
- fsc_utils.sequence_gaps:
partition_by:
- BLOCK_NUMBER

View File

@ -6,8 +6,4 @@
SELECT
*
FROM
{{ ref('testnet__fact_traces') }}
WHERE
from_address <> '0x'
AND
to_address <> '0x'
{{ ref('testnet__fact_traces') }}

View File

@ -12,6 +12,4 @@ models:
tests:
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 1
interval: 1

View File

@ -20,8 +20,4 @@ WHERE
block_number
FROM
last_3_days
)
AND
from_address <> '0x'
AND
to_address <> '0x'
)

View File

@ -6,4 +6,4 @@
SELECT
*
FROM
{{ ref('silver_testnet__traces') }}
{{ ref('silver_testnet__traces') }}

View File

@ -6,7 +6,7 @@ models:
combination_of_columns:
- BLOCK_NUMBER
- TX_POSITION
- TRACE_ADDRESS
- TRACE_INDEX
columns:
- name: BLOCK_NUMBER
tests:
@ -14,19 +14,45 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: TX_POSITION
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: TRACE_ADDRESS
tests:
- not_null
- name: PARENT_TRACE_ADDRESS
- FLOAT
- name: BLOCK_TIMESTAMP
tests:
- not_null:
where: TRACE_ADDRESS <> 'ORIGIN'
where: NOT IS_PENDING
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 1
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- TIMESTAMP_NTZ
- name: TX_HASH
tests:
- not_null:
where: NOT IS_PENDING
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: FROM_ADDRESS
tests:
- not_null:
where: TYPE <> 'SELFDESTRUCT'
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: TO_ADDRESS
tests:
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
where: TO_ADDRESS IS NOT NULL
- name: IDENTIFIER
tests:
- not_null
- name: VALUE
tests:
- not_null
- name: GAS
tests:
- not_null
- name: GAS_USED
tests:
- not_null

View File

@ -20,4 +20,4 @@ WHERE
block_number
FROM
last_3_days
)
)

View File

@ -6,7 +6,7 @@ models:
combination_of_columns:
- BLOCK_NUMBER
- TX_POSITION
- TRACE_ADDRESS
- TRACE_INDEX
columns:
- name: BLOCK_NUMBER
tests:
@ -14,18 +14,21 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: TX_POSITION
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: TRACE_ADDRESS
tests:
- not_null
- name: PARENT_TRACE_ADDRESS
- FLOAT
- name: BLOCK_TIMESTAMP
tests:
- not_null:
where: TRACE_ADDRESS <> 'ORIGIN'
where: NOT IS_PENDING
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 1
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- TIMESTAMP_NTZ
- name: TX_HASH
tests:
- not_null:
where: NOT IS_PENDING
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+

View File

@ -14,7 +14,7 @@ SELECT
FROM
{{ ref("silver_testnet__transactions") }}
tx
LEFT JOIN {{ ref("testnet__fact_traces") }}
LEFT JOIN {{ ref("silver_testnet__traces") }}
tr
ON tx.block_number = tr.block_number
AND tx.tx_hash = tr.tx_hash