Introduction
Before installing dbt, we strongly suggest that you have Linux/Ubuntu already operating in your Windows OS. All the below steps assume you have Windows Subsystem for Linux 2 (WSL2) and Visual Studio code already installed.
Installation process
Your supervisor will provide you with the project folder containing the dbt
code, or where dbt operations will be performed.
Go to the path where dbt operations will be conducted, for example:
cd ~/github4/NIP-Lakehouse-Data/NIP-Lakehouse-Data/dbt
Now create a virtual environment from which you will be conducting your dbt operations.
python3 -m venv nip-dbt-venv
Proceeding onwards, activate the virtual environment.
source nip-dbt-venv/bin/activate
The namespace on your terminal should have (nip-dbt-venv
) appended to it.
Install the dbt-databricks package
To run dbt
from VS Code (and also using the bash terminal since we have WSL2 installed), run the below code to install dbt-databricks.
pip install dbt-databricks
The purpose of the above line is to integrate dbt with Databricks.
Install poetry
The poetry
package helps in installing the required dependencies for your python projects.
pip install poetry
Running the above code may take some time, therefore allow it to run to completion.
The src
folder
The src
is is the folder in which we will be running most of our dbt
code.
cd ~/github4/NIP-Lakehouse-Data/NIP-Lakehouse-Data/dbt/src
Inside the src
folder, run this command which will install any other required packages listed in the packages.yml
file.
dbt deps