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

Some X2Y2 fixes #1497

Merged
merged 6 commits into from
Sep 5, 2022
Merged

Some X2Y2 fixes #1497

merged 6 commits into from
Sep 5, 2022

Conversation

hildobby
Copy link
Collaborator

@hildobby hildobby commented Sep 4, 2022

Brief comments on the purpose of your changes:

Fixed X2Y2's token_id, project, royalty_fee_percentage, platform_fee_percentage and token_standard and make abstraction more efficient (added block_time on joins)

Probably needs a full rerun after merging due to project name change 🤔

For Dune Engine V2
I've checked that:
General checks:

  • I tested the query on dune.com after compiling the model with dbt compile (compiled queries are written to the target directory)
  • I used "refs" to reference other models in this repo and "sources" to reference raw or decoded tables
  • if adding a new model, I added a test
  • the filename is unique and ends with .sql
  • each sql file is a select statement and has only one view, table or function defined
  • column names are lowercase_snake_cased
  • if adding a new model, I edited the dbt project YAML file with new directory path for both models and seeds (if applicable)
  • if adding a new model, I edited the alter table macro to display new database object (table or view) in UI explorer
  • if adding a new materialized table, I edited the optimize table macro

Join logic:

  • if joining to base table (i.e. ethereum transactions or traces), I looked to make it an inner join if possible

Incremental logic:

  • I used is_incremental & not is_incremental jinja block filters on both base tables and decoded tables
    • where block_time >= date_trunc("day", now() - interval '1 week')
  • if joining to base table (i.e. ethereum transactions or traces), I applied join condition where block_time >= date_trunc("day", now() - interval '1 week')
  • if joining to prices view, I applied join condition where minute >= date_trunc("day", now() - interval '1 week')

, seller
, token_id
, ROUND(token_id, 0) AS token_id
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please enforce the token_id type to be an int here just to make sure ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

@soispoke
Copy link
Contributor

soispoke commented Sep 5, 2022

LGTM, thanks @hildobby !

@soispoke soispoke self-requested a review September 5, 2022 12:58
@soispoke soispoke merged commit 49e49a8 into duneanalytics:main Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants