This repository consists of a dbt project that transforms raw data sources into clear, formatted models for Analytics.
All source data is loaded to the RAW database.
tech_store- An internal company databasepayment_app- A third party payment processing application
All transformed data models are deployed to the ANALYTICS_### database.
- Development
- Schema:
DBT_JDOE- One per developer (first initial, last name)
- Schema:
- Production
- Schema:
STAGING- 1:1 with each soure-system table
- Schema:
MARTS- Fully transformed and joined models ready for analytics
- Schema:
- Confirm both Python & Git are on local machine (if not, download them)
- Run
python --versionorpython3 --version - Run
git --version - Set default Git values:
user.name=[user-name]user.email=email@domain.cominit.defaultbranch=maingit config --global --add push.default currentgit config --global push.autoSetupRemote truegit config --global pull.rebase false
- Run
- Download Visual Studio Code & open the new
GitHub/directory - Create a Python virtual environment to isolate project dependencies
- Right-Click under
GitHub/and select "Open Integrated Terminal" - Run
python3 -m venv dbt-envto create virtual environment - Run
source dbt-env/bin/activateto activate & use the virtual environment
- Right-Click under
- Install dbt locally (inside virtual environment) using the proper adapter
- Run
pip install dbt-[adapter]
- Run
- Clone this repository within the
GitHub/folder- Run
git clone https://github.com/[owner]/[repo].git
- Run
- Pull latest repository changes on the
mainbranch- Run
git pull
- Run
- Identify the
profiles.ymlfile on your local machine- Local File Path:
~/.dbt/profiles.yml- Will be hidden by default on Mac/Linux. Press
CMD + SHIFT + .to reveal.
- Will be hidden by default on Mac/Linux. Press
- Copy/Paste contents of
_project_docs/sample-profiles.yml- Update your
datasetaccordingly
- Update your
- Local File Path:
- Validate successful database connection
- Run
cd dbtto switch into dbt project directory - Run
dbt debugto validate dbt can connect
- Run
- Add remote origin
- Run
git remote add origin https://github.com/[USERNAME]/[REPO].git
- Run
- Create a new branch
git branch [branch-name]
- Checkout branch
git checkout [branch-name]
- Download dbt packages
dbt deps
- Start developing!
- IMPORTANT - All changes should follow the team Style Guide
- You'll need to reactivate your Virtual Environment each time by running
source dbt-env/bin/activatefromGitHub/directory- Click here to learn more about using virtual environments w/ dbt, including ways to alias this acticate command.
- John Doe (Developer)
- Jane Doe (Developer)
- Learn more about dbt in the docs
- Check out Discourse for commonly asked questions and answers
- Join the chat on Slack for live discussions and support
- Check out the blog for the latest news on dbt's development and best practices