An 1215/labels (#10)

* labels

* typo

* cluster by address

* docs

* varchar
This commit is contained in:
Jack Forgash 2022-05-16 16:21:54 -06:00 committed by GitHub
parent aa849c8f44
commit 6381b49a6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 166 additions and 0 deletions

View File

@ -0,0 +1,28 @@
{{ config (
materialized = 'view'
) }}
WITH labels AS (
SELECT
system_created_at AS _system_created_at,
insert_date AS _ingested_at,
blockchain,
address,
creator,
label_type,
label_subtype,
address_name,
project_name
FROM
{{ source(
'crosschain',
'address_labels'
) }}
WHERE
blockchain = 'flow'
)
SELECT
*
FROM
labels

View File

@ -0,0 +1,5 @@
{% docs address %}
The on-chain address.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs address_name %}
The name for a specific address, like Kraken or Huobi for CEX, or consensus vs verification for validator.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs blockchain %}
The name of the blockchain for this address.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs creator %}
The source of the labeling information for the address.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs label_subtype %}
The type of address, within the higher order label_type, such as hot wallet, deposit wallet, validator, etc.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs label_type %}
Predominant label categorization, such as CEX, Operator, NFT, etc.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs project_name %}
The overarching project name, related to the address name. For example, Kraken (vs. Kraken Deposit Wallet for address_names).
{% enddocs %}

View File

@ -0,0 +1,24 @@
{{ config(
materialized = 'table',
cluster_by = ['address'],
unique_key = 'event_id',
) }}
WITH labels AS (
SELECT
_ingested_at,
blockchain,
address,
creator,
label_type,
label_subtype,
address_name,
project_name
FROM
{{ ref('bronze__labels') }}
)
SELECT
*
FROM
labels

View File

@ -0,0 +1,73 @@
version: 2
models:
- name: silver__labels
description: |-
This table provides labels for addresses on the Flow blockchain.
columns:
- name: _ingested_at
description: "{{ doc('_ingested_at') }}"
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- TIMESTAMP_NTZ
- name: blockchain
description: "{{ doc('blockchain') }}"
tests:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: address
description: "{{ doc('address') }}"
tests:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: creator
description: "{{ doc('creator') }}"
tests:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: label_type
description: "{{ doc('label_type') }}"
tests:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: label_subtype
description: "{{ doc('label_subtype') }}"
tests:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: address_name
description: "{{ doc('address_name') }}"
tests:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: project_name
description: "{{ doc('project_name') }}"
tests:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR

View File

@ -7,3 +7,9 @@ sources:
tables:
- name: flow_blocks
- name: flow_txs
- name: crosschain
database: flipside_prod_db
schema: crosschain
tables:
- name: address_labels