Thank you for taking the time to submit code in Spellbook. A few things to consider:
- If you are a first-time contributor, please sign the CLA by copy & pasting exactly what the bot mentions in PR comment
- Refer to docs section below to answer questions
- Dune team will review submitted PRs as soon as possible
- Each commit to your feature branch will rerun CI tests (see example)
- This includes all modified models on your branch
- This includes all history of the data
- Two tips for faster development iteration:
- Ensure dbt is installed locally (refer to main
readme
) and rundbt compile
- This will output raw SQL in
target/
directory to copy/paste and run on Dune directly for initial query testing
- This will output raw SQL in
- Hardcode a
WHERE
filter for only ~7 days of history on large source tables, i.e.ethereum.transactions
- This will speed up the CI tests and output results quicker -- whether that's an error or fully successful run
- Once comfortable with small timeframe, remove filter and let full history run
- Ensure dbt is installed locally (refer to main
- Make sure your unique key columns are exactly the same in the model config block, schema yml file, and seed match columns (where applicable)
- There cannot be nulls in the unique key columns
- Be sure to double check key columns are correct or
COALESCE()
as needed on key column(s), otherwise the tests may fail on duplicates
- Be sure to double check key columns are correct or
Once CI completes, you can query the CI tables and errors in dune when it finishes running.
- For example:
- In the
run initial models
andtest initial models
, there will be a schema that looks like this:test_schema.git_dunesql_4da8bae_sudoswap_v2_base_pool_creations
- This can be temporarily queried in Dune for ~24 hours
- In the
Leverage these tables to perform QA testing on Dune query editor -- or even full test dashboards!
The docs directory has been implemented to answer as many questions as possible. Please take the time to reference each .md
file within this directory to understand how to efficiently contribute & why the repo is designed as it is 🪄
Example questions to be answered:
- What does each property in the model config block mean?
- What is the CI test attached to PRs and how can I best utilize it?
- What are the Spellbook best practices?
Please navigate through the docs directory to find as much info as you can.
Note: happy to take PRs to improve the docs, let us know 🤝