An 1079 osmosis labels (#7)

* silver labels models - first pass

* added descriptions

* removed description column in table and re-referenced descriptions in .ymls

* changed config to table set up

* remove comment

Co-authored-by: Desmond Hui <desmond@flipsidecrypto.com>
This commit is contained in:
Jessica Huhnke 2022-04-28 13:32:39 -05:00 committed by GitHub
parent 9272b2dca2
commit 89817b0c71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 173 additions and 1 deletions

View File

@ -0,0 +1,5 @@
{% docs address %}
Address unique to an individual wallet, validator, or token.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs blockchain %}
In this table, always Osmosis. Used to join to cross-chain tables.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs creator %}
Name of the label creator - for now, this will always be "Flipside."
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs label %}
The label or name of the address.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs label_subtype %}
Adds more detail to the label type.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs label_type %}
A broad category that describes what a label is representing.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs project_name %}
The name of the project the label belongs to.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs value %}
Additional details about the validator or token in json format.
{% enddocs %}

View File

@ -0,0 +1,17 @@
{{ config(
materialized = 'table'
) }}
SELECT
'osmosis' AS blockchain,
base AS address,
'flipside' AS creator,
'token' AS label_type,
'token_contract' AS label_subtype,
name AS label,
symbol AS project_name,
denom_units AS value
FROM {{ source(
'osmosis_external',
'asset_metadata_api'
) }}

View File

@ -0,0 +1,46 @@
version: 2
models:
- name: silver__asset_metadata
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- BLOCKCHAIN
- CREATOR
- ADDRESS
columns:
- name: BLOCKCHAIN
description: "{{ doc('blockchain') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_set:
value_set: ['osmosis']
- name: ADDRESS
description: "{{ doc('address') }}"
tests:
- not_null
- name: CREATOR
description: "{{ doc('creator') }}"
tests:
- not_null
- name: LABEL_TYPE
description: "{{ doc('label_type') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_set:
value_set: ['token']
- name: LABEL_SUBTYPE
description: "{{ doc('label_subtype') }}"
tests:
- not_null
- name: LABEL
description: "{{ doc('label') }}"
tests:
- not_null
- name: PROJECT_NAME
description: "{{ doc('project_name') }}"
tests:
- not_null
- name: VALUE
description: "{{ doc('value') }}"
tests:
- not_null

View File

@ -0,0 +1,19 @@
{{ config(
materialized = 'table'
) }}
SELECT
operator_address AS address,
'osmosis' AS blockchain,
'flipside' AS creator,
'operator' AS label_type,
'validator' AS label_subtype,
moniker AS label,
identity AS project_name,
value
FROM
{{ source(
'osmosis_external',
'validator_metadata_api'
) }}

View File

@ -0,0 +1,50 @@
version: 2
models:
- name: silver__validator_metadata
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- CREATOR
- ADDRESS
- BLOCKCHAIN
columns:
- name: ADDRESS
description: "{{ doc('address') }}"
tests:
- not_null
- name: BLOCKCHAIN
description: "{{ doc('blockchain') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_set:
value_set: ['osmosis']
- name: CREATOR
description: "{{ doc('creator') }}"
tests:
- not_null
- name: LABEL_TYPE
description: "{{ doc('label_type') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_set:
value_set: ['operator']
- name: LABEL_SUBTYPE
description: "{{ doc('label_subtype') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_set:
value_set: ['validator']
- name: LABEL
description: "{{ doc('label') }}"
tests:
- not_null
- name: PROJECT_NAME
description: "{{ doc('project_name') }}"
tests:
- not_null
tests:
- not_null
- name: VALUE
description: "{{ doc('value') }}"
tests:
- not_null

View File

@ -6,7 +6,7 @@ sources:
schema: prod
tables:
- name: osmosis_blocks
- name: osmosis_txs
- name: osmosis_txs
- name: osmosis_external
schema: bronze
loader: S3