diff --git a/dbt_project.yml b/dbt_project.yml index ddf0917..1f24842 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -79,4 +79,4 @@ vars: ROLES: - AWS_LAMBDA_EXTERNAL_API - INTERNAL_DEV - - DBT_CLOUD_TON \ No newline at end of file + - DBT_CLOUD_EXTERNAL \ No newline at end of file diff --git a/models/bitquery/gold/bitquery__active_users.sql b/models/bitquery/gold/bitquery__active_users.sql index f205e4c..2509ead 100644 --- a/models/bitquery/gold/bitquery__active_users.sql +++ b/models/bitquery/gold/bitquery__active_users.sql @@ -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 diff --git a/models/bitquery/gold/bitquery__active_users.yml b/models/bitquery/gold/bitquery__active_users.yml index 71e7fd9..6a8fe3b 100644 --- a/models/bitquery/gold/bitquery__active_users.yml +++ b/models/bitquery/gold/bitquery__active_users.yml @@ -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 diff --git a/models/bitquery/gold/bitquery__tx_count.yml b/models/bitquery/gold/bitquery__tx_count.yml index 6d7d81d..8b2cc64 100644 --- a/models/bitquery/gold/bitquery__tx_count.yml +++ b/models/bitquery/gold/bitquery__tx_count.yml @@ -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 \ No newline at end of file diff --git a/models/bitquery/streamline/streamline__bitquery_realtime.sql b/models/bitquery/streamline/streamline__bitquery_realtime.sql index fcad59a..d9dfa95 100644 --- a/models/bitquery/streamline/streamline__bitquery_realtime.sql +++ b/models/bitquery/streamline/streamline__bitquery_realtime.sql @@ -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,