- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2024 11:59 AM
Hey everyone,
So I managed to create a Streamlit app on Databricks, works fine deployed in the cloud.
However, when I try to run it locally, it complains about "assert os.getenv('DATABRICKS_WAREHOUSE_ID'), "DATABRICKS_WAREHOUSE_ID must be set in app.yaml."" It looks like
like this:
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
thanks for that @pdiamond - the underscore didn't work for me, but trying again with the parameter set up it seems that it works now!
I can see the key "sql-warehouse" under App resources. Yours must be set up "sql_warehouse" instead.
Glad we both sorted it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2024 12:51 PM
Hi @AnaMocanu,
How are you setting up: DATABRICKS_WAREHOUSE_ID?
When running the app locally, the environment variables set in the app.yaml
file might not be picked up automatically. You can manually set the environment variable in your local environment before running the app. For example, in a Unix-based system, you can use
export DATABRICKS_WAREHOUSE_ID=<your_warehouse_id>
streamlit run app.py
Additionally, you might want to implement some prints to validate if information is correct:
import os
print("DATABRICKS_WAREHOUSE_ID:", os.getenv('DATABRICKS_WAREHOUSE_ID'))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2024 02:53 PM
Thanks for your reply!
DATABRICKS_WAREHOUSE_ID is set up in yaml file like this:
Your suggestion is how I hack it at the moment, I'm setting up the id manually, but I don't want to do it like that, cause I'm using a serverless warehouse and that value could change?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday - last edited Monday
I'm running into the same problem. Did you ever figure it out?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Monday
Unfortunately not 😞 the other way to avoid it is to not use serverless as the warehouse name won't change then.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
I figured it out this morning. You have to use an underscore in the yaml file instead of a dash. This works for me:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
thanks for that @pdiamond - the underscore didn't work for me, but trying again with the parameter set up it seems that it works now!
I can see the key "sql-warehouse" under App resources. Yours must be set up "sql_warehouse" instead.
Glad we both sorted it.

