-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add static cex labels #1512
Conversation
SELECT blockchain, address, name, category, contributor, source, created_at, updated_at | ||
FROM (VALUES | ||
-- Binance, Source: https://etherscan.io/accounts/label/binance | ||
(array('ethereum'),'0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be', 'Binance 1', 'cex', 'hildobby', 'static', timestamp('2022-08-28'), now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't updated_at
be the same as created_at
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i could see it either way, but if they're the same, then we should just have updated_at
only and leave out created_at
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is to have created_at reflect the moment at which contributors create the query/static labels for the first time, while updated_at reflects the last date at which the table was updated/rebuilt
|
||
labels: | ||
+schema: labels | ||
+materialized: view |
There was a problem hiding this comment.
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'?
SELECT blockchain, address, name, category, contributor, source, created_at, updated_at | ||
FROM (VALUES | ||
-- Binance, Source: https://etherscan.io/accounts/label/binance | ||
(array('ethereum'),'0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be', 'Binance 1', 'cex', 'hildobby', 'static', timestamp('2022-08-28'), now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i could see it either way, but if they're the same, then we should just have updated_at
only and leave out created_at
SELECT blockchain, address, name, category, contributor, source, created_at, updated_at | ||
FROM (VALUES | ||
-- Binance, Source: https://etherscan.io/accounts/label/binance | ||
(array('ethereum'),'0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be', 'Binance 1', 'cex', 'hildobby', 'static', timestamp('2022-08-28'), now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this model is specific to ethereum, do we need to allow an array value for blockchain
since it'll always be ethereum to match the model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just noticed #1513 which i think clarifies my question here. while this PR may not use it, others will in the other PR, then later combined into one object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes exactly, for some more examples you can look at #1474 as well :)
}} | ||
|
||
-- Static Labels | ||
SELECT * FROM {{ ref('labels_cex') }} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's right 👍
SELECT blockchain, address, name, category, contributor, source, created_at, updated_at | ||
FROM (VALUES | ||
-- Binance, Source: https://etherscan.io/accounts/label/binance | ||
(array('ethereum'),'0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be', 'Binance 1', 'cex', 'hildobby', 'static', timestamp('2022-08-28'), now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is to have created_at reflect the moment at which contributors create the query/static labels for the first time, while updated_at reflects the last date at which the table was updated/rebuilt
SELECT blockchain, address, name, category, contributor, source, created_at, updated_at | ||
FROM (VALUES | ||
-- Binance, Source: https://etherscan.io/accounts/label/binance | ||
(array('ethereum'),'0x3f5ce5fbfe3e9af3971dd833d26ba9b5c936f0be', 'Binance 1', 'cex', 'hildobby', 'static', timestamp('2022-08-28'), now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes exactly, for some more examples you can look at #1474 as well :)
}} | ||
|
||
-- Static Labels | ||
SELECT * FROM {{ ref('labels_cex') }} |
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @aalan3 and @jeff-dude for taking the time to review this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think i'm good with this 👍
thanks @jeff-dude ! |
This PR is meant to give an example of static labels added to the spellbook repo for CEX on ethereum.
Brief comments on the purpose of your changes:
For Dune Engine V2
I've checked that:
General checks:
lowercase_snake_cased
Join logic:
Incremental logic: