Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static cex labels #1512

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ models:
ethereum:
+schema: balances_ethereum
+materialized: view

labels:
+schema: labels
+materialized: view
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you leave out the subdirectories (i.e. ethereum) here, will all schemas in the 'labels' directory default to 'labels'?


tokens:
+schema: tokens
Expand Down
3 changes: 3 additions & 0 deletions models/labels/cex/labels_cex.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{config(alias='cex')}}

SELECT * FROM {{ ref('labels_cex_ethereum') }}
496 changes: 496 additions & 0 deletions models/labels/cex/labels_cex_ethereum.sql

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions models/labels/cex/labels_cex_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: 2

models:
- name: labels_cex
meta:
blockchain: ethereum
sector: labels
project: cex
contibutors: hildobby, soispoke
config:
tags: ['labels', 'ethereum', 'cex']
description: "Known centralised exchange addresses across chains"
columns:
- name: blockchain
description: "Blockchain"
- name: address
description: "Address of known CEX"
- name: name
description: "Label name of centralised exchange"
- name: category
description: "Label category"
- name: contributor
description: "Wizard(s) contributing to labels"
- name: source
description: "How were labels generated (could be static or query)"
- name: created_at
description: "When were labels created"
- name: updated_at
description: "When were labels updated for the last time ?"

- name: labels_cex_ethereum
meta:
blockchain: ethereum
sector: labels
project: cex
contibutors: hildobby, soispoke
config:
tags: ['labels', 'ethereum', 'cex']
description: "Known centralised exchange addresses on Ethereum"
columns:
- name: blockchain
description: "Blockchain"
- name: address
description: "Address of known CEX"
- name: name
description: "Label name of centralised exchange"
- name: category
description: "Label category"
- name: contributor
description: "Wizard(s) contributing to labels"
- name: source
description: "How were labels generated (could be static or query)"
- name: created_at
description: "When were labels created"
- name: updated_at
description: "When were labels updated for the last time ?"
8 changes: 8 additions & 0 deletions models/labels/labels_all.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{ config(
alias = 'all',
materialized = 'table',
file_format = 'delta')
}}

-- Static Labels
SELECT * FROM {{ ref('labels_cex') }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what are the future use cases of adding labels here, will they have the same columns and be able to just select * union?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think #1513 may answer this as well, looks like you'll always conform to that standard

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's also right 👍

29 changes: 29 additions & 0 deletions models/labels/labels_all_schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2

models:
- name: labels_all
meta:
blockchain: ethereum, solana
sector: labels
category: cex
contibutors: hildobby, soispoke
config:
tags: ['labels', 'ethereum', 'cex']
description: "All labels across chains and categories"
columns:
- name: blockchain
description: "Blockchain"
- name: address
description: "Label address"
- name: name
description: "Label name"
- name: category
description: "Label category"
- name: contributor
description: "Wizard(s) contributing to labels"
- name: source
description: "How were labels generated (could be static or query)"
- name: created_at
description: "When were labels created"
- name: updated_at
description: "When were labels updated for the last time ?"