lables, docs update (#8)

This commit is contained in:
Austin 2022-06-21 19:07:24 -04:00 committed by GitHub
parent 594d74bc1c
commit 19ed519e29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 133 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,8 @@
# Welcome to the Flipside Crypto Polygon Models Documentation!
# NOTE: Data is in 'lite mode' - meaning, histrorical data has not yet been backfilled. Please see `min(block_timestamp)`
## **What is Flipside?**
[Flipside Crypto](https://flipsidecrypto.xyz/earn) provides Community Enabled Crypto Analytics, allowing our users to create and share data insights on the crypto projects they care most about.
@ -23,10 +25,11 @@ The documentation included here details the design of the Polygon tables and vie
### **Quick Links to Table Documentation**
- [fact_blocks]()
- [fact_event_logs]()
- [fact_traces]()
- [fact_transactions]()
- [fact_blocks](https://flipsidecrypto.github.io/polygon-models/#!/model/model.polygon_models.core__fact_blocks)
- [fact_event_logs](https://flipsidecrypto.github.io/polygon-models/#!/model/model.polygon_models.core__fact_event_logs)
- [fact_traces](https://flipsidecrypto.github.io/polygon-models/#!/model/model.polygon_models.core__fact_traces)
- [fact_transactions](https://flipsidecrypto.github.io/polygon-models/#!/model/model.polygon_models.core__fact_transactions)
- [dim_lables](https://flipsidecrypto.github.io/polygon-models/#!/model/model.polygon_models.core__dim_labels)
## **Data Model Overview**

View File

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

View File

@ -0,0 +1,5 @@
{% docs matic_label_address %}
Address that the label is for. This is the field that should be used to join other tables with labels.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs matic_label_address_name %}
The most granular label for this address.
{% enddocs %}

View File

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

View File

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

View File

@ -0,0 +1,5 @@
{% docs matic_label_subtype %}
A sub-category nested within label type providing further detail.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs matic_label_type %}
A high-level category describing the addresses main function or ownership.
{% enddocs %}

View File

@ -0,0 +1,5 @@
{% docs matic_labels_table %}
This table contains labels for addresses on the Polygon Blockchain.
{% enddocs %}

View File

@ -0,0 +1,22 @@
{{ config(
materialized = 'view',
persist_docs ={ "relation": true,
"columns": true }
) }}
SELECT
blockchain,
creator,
address,
address_name,
label_type,
label_subtype,
project_name
FROM
{{ source(
'crosschain',
'address_labels'
) }}
WHERE
blockchain = 'polygon'
AND address LIKE '0x%'

View File

@ -0,0 +1,57 @@
version: 2
models:
- name: core__dim_labels
description: '{{ doc("matic_labels_table") }}'
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns:
- BLOCKCHAIN
- CREATOR
- ADDRESS
columns:
- name: BLOCKCHAIN
description: '{{ doc("matic_label_blockchain") }}'
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_set:
value_set: ['polygon']
- name: CREATOR
description: '{{ doc("matic_label_creator") }}'
tests:
- not_null
- name: ADDRESS
description: '{{ doc("matic_label_address") }}'
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: 0[xX][0-9a-fA-F]+
- name: ADDRESS_NAME
description: '{{ doc("matic_labels_table") }}'
tests:
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: LABEL_TYPE
description: '{{ doc("matic_label_type") }}'
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_set:
value_set: ['flotsam', 'nft', 'defi', 'dex', 'cex', 'dapp', 'token', 'operator', 'layer2', 'chadmin', 'project']
- name: LABEL_SUBTYPE
description: '{{ doc("matic_label_subtype") }}'
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR
- name: PROJECT_NAME
description: '{{ doc("matic_project_name") }}'
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_in_type_list:
column_type_list:
- STRING
- VARCHAR

View File

@ -7,4 +7,9 @@ sources:
tables:
- name: polygon_blocks
- name: polygon_txs
- name: crosschain
database: flipside_prod_db
schema: crosschain
tables:
- name: address_labels