Thank you for your interest in contributing to the dbt Artifacts Package! We welcome contributions of all kinds, including bug reports, feature requests, and pull requests.
Please read this document to learn how to contribute. Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests.
If you find a bug, please open an issue and describe the problem. If possible, include a minimal example that maintainers can use to reproduce the issue. If you are able to fix the bug, please open a pull request with a fix.
If you would like to request a new feature, please open an issue and describe the desired behavior. If you are able to implement the feature, please open a pull request with your changes. If you need help with either of these steps, please let us know!
- To get an overview of the project, read our README.
- There's a fair bit of infrastructure to set up for integration testing, read more in MAINTAINERS.md
- Look for issues labeled as "good first issue" - these are issues which would be good for newcomers.
The high-level flow for contributing code to the dbt Artifacts Package is as follows (see below for details of each stage):
- Fork the dbt Artifacts Package repository
- The first step to contributing code is to fork the dbt Artifacts Package repository. Once you have a fork, you can clone it locally and begin making changes.
- Clone your fork locally
- Create a new branch
- Make your changes
- Run the tests
- Open a pull request against the
mainbranch- Fill out the PR template. This template helps reviewers understand your changes as well as the purpose of your pull request.
- Don't forget to link PR to issue if you are solving one.
- Make sure your pull request passes all checks
- Address any review feedback
- As you update your PR and apply changes, mark each conversation as resolved.
- Enable the checkbox to allow maintainer edits so the branch can be updated for a merge. Once you submit your PR, a maintainer will review your proposal. We may ask questions or request additional information.
- Merge your pull request 🎉
To run the tests, we use tox. Tox is a tool that automates testing in multiple Python environments. Tox is a CLI tool that needs a Python interpreter (version 3.7 or higher) to run. We recommend pipx to install tox into an isolated environment. This has the added benefit that later you’ll be able to upgrade tox without affecting other parts of the system.
Tox will take care of installing the dependencies for each environment, so you don’t need to worry about that.
-
Install pipx
pip install pipx pipx ensurepath
-
Install tox
pipx install tox
-
Copy and paste the
integration_test_project/example-env.shfile and save asenv.sh. Fill in the missing values. If you want to run only tests for a specific database, you can leave the other values blank.cp integration_test_project/example-env.sh env.sh vim env.sh
-
Source the file in your current shell context with the command:
. ./env.sh -
From the root directory, run the tests for the databases you have access to below:
tox -e integration_snowflake # For the Snowflake tests tox -e integration_databricks # For the Databricks tests tox -e integration_bigquery # For the BigQuery tests
The Spark tests require installing the ODBC driver. On a Mac,
DBT_ENV_SPARK_DRIVER_PATH should be set to /Library/simba/spark/lib/libsparkodbc_sbu.dylib. Spark tests have not yet
been added to the integration tests.
If you don't have access to a particular database type, this isn't a problem. Test on the one you do have, and let us know in the PR.
We use SQLFluff to keep SQL style consistent. A GitHub action automatically tests pull requests and adds annotations
where there are failures. SQLFluff can also be run locally with tox.
Lint all models in the /models directory:
toxFix all models in the /models directory:
tox -e fix_allLint (or subsitute lint to fix) a specific model:
tox -e lint -- models/path/to/model.sqlLint (or subsitute lint to fix) a specific directory:
tox -e lint -- models/path/to/directoryEnforced rules are defined within tox.ini. To view the full list of available rules and their configuration, see
the SQLFluff documentation.