Skip to content

Commit

Permalink
test fixes and dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
forgxyz committed Jun 3, 2022
1 parent 1fb40e0 commit 4adec9c
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM dbt-labs/dbt:1.0.0
FROM fishtownanalytics/dbt:1.0.0
WORKDIR /support
RUN mkdir /root/.dbt
COPY profiles.yml /root/.dbt
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ clean-targets: # directories to be removed by `dbt clean`
# as tables. These settings can be overridden in the individual model files
# using the `{{ config(...) }}` macro.
models:
+post-hook: "grant select on {{ this }} to share near_mdao"
+post-hook: "{% if target.name == 'prod_cloud' %}} grant select on {{ this }} to share near_mdao {% endif %}"

tests:
+warn_if: "between 1 and 25000"
Expand Down
4 changes: 4 additions & 0 deletions models/core/actions_events_addkey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: public_key
description: The public key of an AccessKey which was used to sign the original transaction. In case of a deposit refund, the public key is empty (all bytes are 0).
Expand Down Expand Up @@ -71,6 +72,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
- NULL

- name: method_name
Expand All @@ -79,6 +81,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- ARRAY
- VARIANT
- OBJECT
- NULL

- name: receiver_id
Expand Down
2 changes: 2 additions & 0 deletions models/core/actions_events_function_call.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: attached_gas
description: Units of gas (figure is not decimal adjusted, 10^12) attached to the transaction (this is often higher than 'Gas Used').
tests:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: ingested_at
description: The timestamp for when the block was ingested.
Expand Down
31 changes: 24 additions & 7 deletions models/core/blocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER

- FLOAT

- name: block_author
description: The `block_author` taken from block headers. Validators of the blockchain.
tests:
Expand All @@ -66,6 +67,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- ARRAY
- VARIANT
- OBJECT

- name: block_challenges_root
description: The block_challenges_root taken from block headers. TODO check this column expectation, number?
Expand All @@ -92,6 +95,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- ARRAY
- VARIANT
- OBJECT

- name: chunk_receipts_root
description: The chunk_receipts_root taken from block headers.
Expand All @@ -118,6 +123,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- ARRAY
- VARIANT
- OBJECT

- name: chunks_included
description: The chunks_included taken from block headers.
Expand Down Expand Up @@ -152,15 +159,18 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- ARRAY

- VARIANT
- OBJECT

- name: gas_price
description: The gas_price taken from block headers, number is not decimal adjusted.
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER

- FLOAT

- name: last_ds_final_block
description: The last_ds_final_block taken from block headers.
tests:
Expand All @@ -186,7 +196,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER

- FLOAT

- name: next_bp_hash
description: The next_bp_hash taken from block headers.
tests:
Expand Down Expand Up @@ -229,7 +240,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER

- FLOAT

- name: prev_state_root
description: The prev_state_root taken from block headers. TODO can this be null?
tests:
Expand All @@ -254,7 +266,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER

- FLOAT

- name: signature
description: The signature taken from block headers.
tests:
Expand All @@ -271,14 +284,17 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER

- FLOAT

- name: validator_proposals
description: The validator_proposals taken from block headers.
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- ARRAY
- VARIANT
- OBJECT

- name: validator_reward
description: The validator_reward taken from block headers.
Expand All @@ -287,6 +303,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: ingested_at
description: The timestamp for when the block was ingested.
Expand Down
6 changes: 6 additions & 0 deletions models/core/receipts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- ARRAY
- VARIANT
- OBJECT

- name: status_value
description: "{{ doc('status_value')}}"
Expand All @@ -71,6 +73,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- ARRAY
- VARIANT
- OBJECT

- name: proof
description: "{{ doc('proof')}}"
Expand All @@ -79,6 +83,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- ARRAY
- VARIANT
- OBJECT

- name: metadata
description: "{{ doc('metadata')}}"
Expand Down
5 changes: 5 additions & 0 deletions models/core/transactions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- ARRAY
- VARIANT
- OBJECT

- name: gas_used
description: Units of gas required to execute this transaction.
Expand All @@ -121,6 +123,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: attached_gas
description: Units of gas attached to the transaction (this is often higher than 'Gas Used').
Expand All @@ -129,6 +132,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: transaction_fee
description: Total fee paid in yoctoNEAR to execute this transaction.
Expand All @@ -137,6 +141,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: ingested_at
description: The timestamp for when the block was ingested.
Expand Down
3 changes: 3 additions & 0 deletions models/core/transfers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: receipt_object_id
description: The unique id of the reciept object that corresponds to this transaction.
Expand All @@ -80,6 +81,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: gas_used
description: Units of gas required to execute this transaction. In raw number format, to adjust divide by POW(10,12)
Expand All @@ -88,6 +90,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: status
description: Boolean representing the success or failure of the transaction. True for a successful transaction and False for failed transaction.
Expand Down
3 changes: 3 additions & 0 deletions models/metrics/metrics_active_wallets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: rolling_7day_active_wallets
description: The number of active wallets in the last 7 days.
Expand All @@ -29,6 +30,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: rolling_30day_active_wallets
description: The number of active wallets in the last 30 days.
Expand All @@ -37,3 +39,4 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
2 changes: 2 additions & 0 deletions models/metrics/metrics_daily_gas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT

- name: avg_gas_price
description: The average gas price in transactions. NOT Decimal adjusted; units in yoctoNEAR (10^-24 NEAR)
Expand All @@ -29,3 +30,4 @@ models:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- FLOAT
3 changes: 2 additions & 1 deletion models/metrics/metrics_daily_transactions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ models:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- NUMBER
- NUMBER
- FLOAT

0 comments on commit 4adec9c

Please sign in to comment.