mirror of
https://github.com/FlipsideCrypto/flow-models.git
synced 2026-02-06 11:06:45 +00:00
An 1215/labels (#10)
* labels * typo * cluster by address * docs * varchar
This commit is contained in:
parent
aa849c8f44
commit
6381b49a6a
28
models/bronze/bronze__labels.sql
Normal file
28
models/bronze/bronze__labels.sql
Normal 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
|
||||
5
models/descriptions/address.md
Normal file
5
models/descriptions/address.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs address %}
|
||||
|
||||
The on-chain address.
|
||||
|
||||
{% enddocs %}
|
||||
5
models/descriptions/address_name.md
Normal file
5
models/descriptions/address_name.md
Normal 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 %}
|
||||
5
models/descriptions/blockchain.md
Normal file
5
models/descriptions/blockchain.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs blockchain %}
|
||||
|
||||
The name of the blockchain for this address.
|
||||
|
||||
{% enddocs %}
|
||||
5
models/descriptions/creator.md
Normal file
5
models/descriptions/creator.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs creator %}
|
||||
|
||||
The source of the labeling information for the address.
|
||||
|
||||
{% enddocs %}
|
||||
5
models/descriptions/label_subtype.md
Normal file
5
models/descriptions/label_subtype.md
Normal 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 %}
|
||||
5
models/descriptions/label_type.md
Normal file
5
models/descriptions/label_type.md
Normal file
@ -0,0 +1,5 @@
|
||||
{% docs label_type %}
|
||||
|
||||
Predominant label categorization, such as CEX, Operator, NFT, etc.
|
||||
|
||||
{% enddocs %}
|
||||
5
models/descriptions/project_name.md
Normal file
5
models/descriptions/project_name.md
Normal 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 %}
|
||||
24
models/silver/silver__labels.sql
Normal file
24
models/silver/silver__labels.sql
Normal 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
|
||||
73
models/silver/silver__labels.yml
Normal file
73
models/silver/silver__labels.yml
Normal 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
|
||||
@ -7,3 +7,9 @@ sources:
|
||||
tables:
|
||||
- name: flow_blocks
|
||||
- name: flow_txs
|
||||
|
||||
- name: crosschain
|
||||
database: flipside_prod_db
|
||||
schema: crosschain
|
||||
tables:
|
||||
- name: address_labels
|
||||
Loading…
Reference in New Issue
Block a user