Streamlit app on Databricks doesn't recognise the DATABRICKS_WAREHOUSE_ID in the yaml file

AnaMocanu
Contributor

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 

valueFrom: "sql-warehouse" is not being picked up properly in the yaml file. In the app config, it created a service principal with the "sql-warehouse" key that should pick up my serverless warehouse that I want to use.
My workaround is to specify the value of the warehouse as an environment variable in the app.py and that seems to work. 
like this:
#assert os.getenv('DATABRICKS_WAREHOUSE_ID'), "DATABRICKS_WAREHOUSE_ID must be set in app.yaml."
os.environ['DATABRICKS_WAREHOUSE_ID'] = my_value
 
Any thoughts on how to enforce the yaml file to pick up the right values?
 
Many thanks!
Ana