This commit is contained in:
Sam 2024-04-02 13:29:39 +08:00 committed by GitHub
parent ded146796e
commit d86fa16624
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 2167 additions and 12 deletions

View File

@ -37,6 +37,8 @@ SELECT
total_fees_usd,
platform_fee_usd,
creator_fee_usd,
tx_fee,
tx_fee_usd,
origin_from_address,
origin_to_address,
origin_function_signature,

View File

@ -38,7 +38,7 @@ WITH nft_base_models AS (
FROM
{{ ref('silver__quix_sales') }}
{% if is_incremental() %}
{% if is_incremental() and 'quix' not in var('HEAL_CURATED_MODEL') %}
WHERE
_inserted_timestamp >= (
SELECT
@ -80,7 +80,7 @@ SELECT
FROM
{{ ref('silver__quix_seaport_sales') }}
{% if is_incremental() %}
{% if is_incremental() and 'quix_seaport' not in var('HEAL_CURATED_MODEL') %}
WHERE
_inserted_timestamp >= (
SELECT
@ -122,7 +122,7 @@ SELECT
FROM
{{ ref('silver__seaport_1_1_sales') }}
{% if is_incremental() %}
{% if is_incremental() and 'seaport_1_1' not in var('HEAL_CURATED_MODEL') %}
WHERE
_inserted_timestamp >= (
SELECT
@ -164,7 +164,7 @@ SELECT
FROM
{{ ref('silver__seaport_1_4_sales') }}
{% if is_incremental() %}
{% if is_incremental() and 'seaport_1_4' not in var('HEAL_CURATED_MODEL') %}
WHERE
_inserted_timestamp >= (
SELECT
@ -206,7 +206,49 @@ SELECT
FROM
{{ ref('silver__seaport_1_5_sales') }}
{% if is_incremental() %}
{% if is_incremental() and 'seaport_1_5' not in var('HEAL_CURATED_MODEL') %}
WHERE
_inserted_timestamp >= (
SELECT
MAX(
_inserted_timestamp
) - INTERVAL '36 hours'
FROM
{{ this }}
)
{% endif %}
UNION ALL
SELECT
block_number,
block_timestamp,
tx_hash,
event_index,
event_type,
platform_address,
platform_name,
platform_exchange_version,
seller_address,
buyer_address,
nft_address,
erc1155_value :: STRING AS erc1155_value,
tokenId,
currency_address,
total_price_raw,
total_fees_raw,
platform_fee_raw,
creator_fee_raw,
tx_fee,
origin_from_address,
origin_to_address,
origin_function_signature,
input_data,
nft_log_id,
_log_id,
_inserted_timestamp
FROM
{{ ref('silver__seaport_1_6_sales') }}
{% if is_incremental() and 'seaport_1_6' not in var('HEAL_CURATED_MODEL') %}
WHERE
_inserted_timestamp >= (
SELECT

View File

@ -60,7 +60,7 @@ models:
- name: CURRENCY_ADDRESS
tests:
- not_null:
where: platform_exchange_version not in ('seaport_1_1', 'seaport_1_4', 'seaport_1_5')
where: platform_exchange_version not in ('seaport_1_1', 'seaport_1_4', 'seaport_1_5', 'seaport_1_6')
- name: PRICE
tests:
- not_null

View File

@ -16,9 +16,6 @@ models:
- name: BLOCK_TIMESTAMP
tests:
- not_null
- 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_LTZ
@ -101,9 +98,6 @@ models:
- name: _INSERTED_TIMESTAMP
tests:
- not_null
- 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_LTZ

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,133 @@
version: 2
models:
- name: silver__seaport_1_6_sales
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- nft_log_id
columns:
- name: BLOCK_NUMBER
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: BLOCK_TIMESTAMP
tests:
- not_null
- 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_LTZ
- TIMESTAMP_NTZ
- name: TX_HASH
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: PLATFORM_ADDRESS
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: PLATFORM_NAME
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_set:
value_set: ['opensea']
- name: SELLER_ADDRESS
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: BUYER_ADDRESS
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: NFT_ADDRESS
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: TOKENID
tests:
- not_null
- name: CURRENCY_ADDRESS
tests:
- not_null:
where: "total_price_raw > 0"
- name: TOTAL_PRICE_RAW
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: TOTAL_FEES_RAW
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: PLATFORM_FEE_RAW
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: CREATOR_FEE_RAW
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: TX_FEE
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- name: NFT_LOG_ID
tests:
- not_null
- name: _INSERTED_TIMESTAMP
tests:
- not_null
- 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_LTZ
- TIMESTAMP_NTZ
- name: ORIGIN_FROM_ADDRESS
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: ORIGIN_TO_ADDRESS
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: ORIGIN_FUNCTION_SIGNATURE
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: EVENT_TYPE
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_set:
value_set: ['bid_won', 'sale']
- name: INPUT_DATA
tests:
- not_null