Contribution Workflow
Last updated
Was this helpful?
Last updated
Was this helpful?
[ this workflow will be actively updated and enhanced as we receive feedback ]
Create and contribute your first model
Understand the modeling structure
Data models iterate through different “layers”. Generally speaking these are bronze, silver, and core. How these layers interact is defined in .
Create model file within the proper layer and naming convention
Naming convention for file is <layer name>__<table name>.sql
Example for silver layer: ./models/silver/silver__my_new_table.sql
Create a corresponding .yml file
This should hold any model/column descriptions and tests for the model/columns
Example for silver layer: ./models/silver/silver__my_new_table.yml
Start writing SQL code
Write code in Snowflake Web UI (Snowsight):
Snowsight documentation:
Turn SQL code into DBT SQL
dbt combines sql with Jinja, see more:
Copy sql code into the file created earlier
Add config section
See existing models for examples
Dbt docs for available configurations
Convert SQL elements into Jinja
Commonly this is changing table name to references and adding incremental loading logic
Ref:
Incremental logic:
See existing curated models for examples on how to implement incremental logic. ethereum-models/models/silver/silver__transactions.sql
Run the dbt model to put it into the community dev database. You must run this command within the dbt-console. If you have exited the console run make dbt-console
again
dbt run -s <path to model>
Run:
If this is your 1st time using dbt run
in this docker container, you may need to run dbt deps
command
Models will be deployed to <BLOCKCHAIN>_COMMUNITY_DEV
database within Snowflake. This database refreshes daily at 04:00 AM UTC
, any non-production resources will be erased.
Run the test file
dbt test -s <path to mode>
Tests:
Create GitHub Pull Request and write a summary on your updates/changes, as well as attaching passing test logs
Request Reviewer from one of the GitHub handles below
austinFlipside
juls858
James-Mission
desmond-hui
Fix Review Comments
Re-Request Reviewer after fixing review comments
If your PR has been approved, merge it to production
Congratulations! You’ve successfully contributed a data model!