mirror of
https://github.com/FlipsideCrypto/base-models.git
synced 2026-02-06 14:46:51 +00:00
unique key tests and desc
This commit is contained in:
parent
20c533e9e5
commit
e6b3aae6d0
@ -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)
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
12
models/silver/prices/silver__asset_metadata_priority.yml
Normal file
12
models/silver/prices/silver__asset_metadata_priority.yml
Normal 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
|
||||
@ -1,6 +1,6 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = ['token_address', 'hour'],
|
||||
unique_key = ['token_address', 'hour', 'provider'],
|
||||
tags = ['non_realtime']
|
||||
) }}
|
||||
|
||||
|
||||
17
models/silver/prices/silver__hourly_prices_all_providers.yml
Normal file
17
models/silver/prices/silver__hourly_prices_all_providers.yml
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user