Smoke-testing
🎉 Time to fire-up that bad boy ! 🎉
virtualenv / poetry env to be used to run the ETL should (usually) be the one from the core.dashboards_store folder. If you want to use a custom set of dependencies, you are responsible for configuring the cssXX.dashboards_store/pyproject.toml file according to your needs.We assume you have an opened terminal in the <working dir> folder.
- Enable the python environment
The Python environment must be activated so dbt can be run. If you get an error message about the dbt command not being found, you probably forgot to activate it.
cd core.dashboards_store
eval $(poetry env activate)
- Move back to your
cssXX.dashboards_storefolderSince your
cssXX.dashboards_storemight override some of the Core's models, and since it implements the contracts defined by the Store, you should always run the ETL from thecssXX.dashboards_storefolder.
cd ../cssXX.dashboards_store
- Run the debug command to test the connection :
dbt debug
The output should look like this :
15:29:16 Running with dbt=1.4.7
dbt version: 1.4.7
python version: 3.8.10
python path: /home/<store_user>/.cache/pypoetry/virtualenvs/core.dashboards_store-pQVMzw-y-py3.8/bin/python
os info: Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.29
Using profiles.yml file at /home/<store_user>/<working_directory>/<cssXX>.dashboards_store/profiles.yml
Using dbt_project.yml file at /home/<store_user>/<working_directory>/<cssXX>.dashboards_store/dbt_project.yml
Configuration:
profiles.yml file [OK found and valid]
dbt_project.yml file [OK found and valid]
Required dependencies:
- git [OK found]
Connection:
server: <store\'s server IP>
database: <store_dev>
schema: <store_user> -- the default schema should be your name
port: <store\'s server port>
UID: <store_user>
client_id: None
authentication: sql
encrypt: True
trust_cert: True
retries: 1
login_timeout: 0
query_timeout: 0
Connection test: [OK connection ok]
All checks passed!
What did I just do ?
- If you get the awesome
All checks passed!, you have successfully configured your project. You haven't materialized anything yet, but at least you know the database can be reached from the computer. You still have to populate the various seeds and models, and to configure thecssXX.dashboards_store/dbt_project.ymlfile to be able to materialize the models underlying the dashboards. - If you get an error, obviously something is not working:
- Make sure your database's credentials are correct (try to connect to the database using the same credentials within SSMS)
- Make sure your database is actually reachable from your computer (try the
telnet <database's IP> <database's port>) - Try googling the error message, it might be a common issue. May the first-page-of-google always be in your favor.
Database connection
For now, we haven't connected the Store to the database. To connect the Store to the database and start materializing our views and tables, we need to tell dbt where to look for the database credentials and connection information. We do this by creating a profiles.yml file.
What now ?
You have a working cssXX.dashboards_store dbt project that can be used to populate the Store's database. Unfortunately, you are not done yet: you still have to configure the cssXX.dashboards_store project and run the ETL.
