unique key tests and desc

This commit is contained in:
drethereum 2023-08-30 09:18:00 -06:00
parent 20c533e9e5
commit e6b3aae6d0
6 changed files with 54 additions and 4 deletions

View File

@ -18,4 +18,6 @@ models:
- name: DECIMALS
description: The number of decimals for token contract
- name: PRICE
description: Closing price of the recorded hour in USD
description: Closing price of the recorded hour in USD
- name: IS_IMPUTED
description: Whether the price was imputed from an earlier record (generally used for low trade volume tokens)

View File

@ -1,6 +1,6 @@
{{ config(
materialized = 'incremental',
unique_key = 'token_address',
unique_key = ['token_address','symbol','id','provider'],
tags = ['non_realtime']
) }}
@ -13,7 +13,8 @@ SELECT
) AS symbol,
token_name AS NAME,
token_decimals AS decimals,
provider
provider,
p._inserted_timestamp
FROM
{{ ref('bronze__asset_metadata_all_providers') }}
p

View File

@ -0,0 +1,18 @@
version: 2
models:
- name: silver__asset_metadata_all_providers
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- TOKEN_ADDRESS
- SYMBOL
- PROVIDER
- ID
columns:
- name: TOKEN_ADDRESS
tests:
- not_null
- name: PROVIDER
tests:
- not_null

View File

@ -0,0 +1,12 @@
version: 2
models:
- name: silver__asset_metadata_priority
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- TOKEN_ADDRESS
columns:
- name: TOKEN_ADDRESS
tests:
- not_null

View File

@ -1,6 +1,6 @@
{{ config(
materialized = 'incremental',
unique_key = ['token_address', 'hour'],
unique_key = ['token_address', 'hour', 'provider'],
tags = ['non_realtime']
) }}

View File

@ -0,0 +1,17 @@
version: 2
models:
- name: silver__hourly_prices_all_providers
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- TOKEN_ADDRESS
- HOUR
- PROVIDER
columns:
- name: HOUR
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 1