Dash app for displaying visualizations fro RPF project
First git clone
this repo.
Then generate and obtain your access token from databricks following this instruction: https://docs.databricks.com/en/dev-tools/auth/pat.html Get connection details for the SQL Warehouse compute resource which is used for providing the database connection: https://docs.databricks.com/en/integrations/compute-details.html
Export the obtained information to the following environment variables:
export ACCESS_TOKEN="[access token]"
export SERVER_HOSTNAME="[server hostname, e.g. adb-12345678.12.azuredatabricks.net"
export HTTP_PATH="[http path, e.g. /sql/1.0/warehouses/abcdxxx123]"
# For M2 Max Chip
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
Then to setup and verify the app works locally:
pip install -r requirements.txt
python app.py
open http://127.0.0.1:8050/
You should see the data app.
To run the python unit tests:
python -m unittest discover tests/
Make sure all tests pass locally before sending a PR.
- Edit .env to update your environment variables after copying the sample env file. (Do not use quotations around the values)
cp .env.example .env
- Run the following commands
docker build . --tag dash
docker run -p 8080:8080 -v ./:/dash-app --env-file .env dash