This commit is contained in:
Eric Laurello 2025-03-14 13:28:40 -04:00
parent 038f6506de
commit c8df4f60e8
5 changed files with 24 additions and 17 deletions

View File

@ -79,4 +79,4 @@ vars:
ROLES:
- AWS_LAMBDA_EXTERNAL_API
- INTERNAL_DEV
- DBT_CLOUD_TON
- DBT_CLOUD_EXTERNAL

View File

@ -61,7 +61,7 @@ SELECT
_inserted_timestamp,
{{ dbt_utils.generate_surrogate_key(
['blockchain','metric','as_of_date']
) }} AS accounts_id,
) }} AS active_users_id,
SYSDATE() AS inserted_timestamp,
SYSDATE() AS modified_timestamp,
'{{ invocation_id }}' AS _invocation_id

View File

@ -1,6 +1,8 @@
version: 2
models:
- name: bitquery__active_users
description: >
This model returns the number of active users for each blockchain and as of date. The distinct number of users is from the 30 days prior to the as of date.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
@ -10,24 +12,26 @@ models:
columns:
- name: BLOCKCHAIN
description: >
The blockchain where the active users are from.
tests:
- not_null
- name: METRIC
description: >
The metric name - always 'active_users'.
tests:
- not_null
- name: AS_OF_DATE
description: >
The date when the active users are counted.
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 2
- name: ACTIVE_USERS
description: >
The number of active users. The distinct number of users is from the 30 days prior to the as of date.
tests:
- not_null
- name: _INSERTED_TIMESTAMP
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- TIMESTAMP_NTZ

View File

@ -1,6 +1,8 @@
version: 2
models:
- name: bitquery__tx_count
description: >
This model returns the number of transactions for each blockchain and block date.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
@ -10,24 +12,25 @@ models:
columns:
- name: BLOCKCHAIN
description: >
The blockchain where the transactions are from.
tests:
- not_null
- name: METRIC
description: >
The metric name - always 'tx_count'.
tests:
- not_null
- name: BLOCK_DATE
description: >
The date when the transactions are counted.
tests:
- not_null
- dbt_expectations.expect_row_values_to_have_recent_data:
datepart: day
interval: 2
- name: TX_COUNT
description: >
The number of transactions for this date.
tests:
- not_null
- name: _INSERTED_TIMESTAMP
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- TIMESTAMP_NTZ
- not_null

View File

@ -24,7 +24,7 @@ WITH metrics AS (
variables
FROM
{{ ref("streamline__bitquery_metrics") }} A
LEFT JOIN {{ ref("streamline__bitquery_metrics") }}
LEFT JOIN {{ ref("streamline__bitquery_complete") }}
b USING (
blockchain,
metric,