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

Gains Network Perpetual for Base #7437

Merged
merged 20 commits into from
Jan 29, 2025

Conversation

PatelPrinci
Copy link
Contributor

Thank you for contributing to Spellbook 🪄

Please open the PR in draft and mark as ready when you want to request a review.

Description:

[...]


quick links for more information:

@github-actions github-actions bot marked this pull request as draft January 8, 2025 12:41
@github-actions github-actions bot added WIP work in progress dbt: hourly covers the hourly dbt subproject labels Jan 8, 2025
@PatelPrinci PatelPrinci marked this pull request as ready for review January 10, 2025 04:12
@github-actions github-actions bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Jan 10, 2025
@jeff-dude jeff-dude requested a review from Hosuke January 13, 2025 19:11
Comment on lines 4 to 7
post_hook='{{ expose_spells(\'["base"]\',
"project",
"gains_network",
\'["princi"]\') }}'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remember to apply the new format to post_hook.

Comment on lines 20 to 23
blockchain
,block_date
,block_month
,block_time
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please be consistent in space/tab indentation.

Suggested change
blockchain
,block_date
,block_month
,block_time
blockchain
,block_date
,block_month
,block_time

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you can fix the tabs here.

tx."to" AS tx_to,
perps.evt_index
FROM perps
INNER JOIN delta_prod.base.transactions AS tx
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may need to introduece a CTE for transactions table with incremental filters before inner join.

source() syntax is needed here as well.

@Hosuke Hosuke added in review Assignee is currently reviewing the PR and removed ready-for-review this PR development is complete, please review labels Jan 15, 2025
tx."to" AS tx_to,
perps.evt_index
FROM perps
INNER JOIN {{ source('base', 'transactions') }} AS tx
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can make a transactions_filtered CTE with incremental filter first for fast loading.

Copy link
Collaborator

@Hosuke Hosuke left a comment

Choose a reason for hiding this comment

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

After schema fixed, you may consider adding gains_network_perpetual_trades into perpetual_trades:
https://github.com/duneanalytics/spellbook/blob/main/dbt_subprojects/hourly_spellbook/models/_sector/perpetual/perpetual_trades.sql

Comment on lines 20 to 23
blockchain
,block_date
,block_month
,block_time
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you can fix the tabs here.

Comment on lines 2 to 3
schema = 'gains_network_perpetual_trades',
alias = 'perpetual_trades',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please fix the schema:

Suggested change
schema = 'gains_network_perpetual_trades',
alias = 'perpetual_trades',
schema = 'gains_network',
alias = 'perpetual_trades',

@@ -0,0 +1,221 @@
{{ config(
schema = 'gains_network_base',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
schema = 'gains_network_base',
schema = 'gains_network_v1_base',

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please rename this file to match schema+alias:
gains_network_perpetual_trades.sql

Copy link
Collaborator

@Hosuke Hosuke left a comment

Choose a reason for hiding this comment

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

@jeff-dude jeff-dude added ready-for-merging and removed in review Assignee is currently reviewing the PR labels Jan 29, 2025
@jeff-dude jeff-dude merged commit 90c8baf into duneanalytics:main Jan 29, 2025
4 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dbt: hourly covers the hourly dbt subproject ready-for-merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants