From 32a732ef49e5691a74514ec5435f40ed641b1522 Mon Sep 17 00:00:00 2001
From: verena <9377970+vpchung@users.noreply.github.com>
Date: Thu, 6 Feb 2025 11:56:25 -0800
Subject: [PATCH 1/3] specify python versions for development
---
README.md | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/README.md b/README.md
index 20a4a6f..e6e568f 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,13 @@ streamlit-snowflake-template/
└── style.css
```
+## Requirements & Installation
+
+* Python 3.9 - 3.11*
+* [Snowflake account]
+
+\*[Snowpark Python] currently only supports these Python versions
+
## Create your own Streamlit application
### 1. Setup and Enable Access to Snowflake
From a08f79652ba56690f03dc4b60b112800ec915d31 Mon Sep 17 00:00:00 2001
From: verena <9377970+vpchung@users.noreply.github.com>
Date: Thu, 6 Feb 2025 11:57:30 -0800
Subject: [PATCH 2/3] add virtual env suggestion + code example
---
README.md | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/README.md b/README.md
index e6e568f..68c56a5 100644
--- a/README.md
+++ b/README.md
@@ -32,6 +32,23 @@ streamlit-snowflake-template/
\*[Snowpark Python] currently only supports these Python versions
+For best practice, use [miniconda], [Anaconda], or [virtualenv] to create a Python 3.9, 3.10, or 3.11 environment, then install the app dependencies. Here is an example using miniconda:
+
+```
+# Create a new env and activate it
+conda create -n streamlit-app python=3.11 -y
+conda activate streamlit-app
+
+# Install dependencies with pip
+pip install -r requirements.txt
+```
+
+[Snowflake account]: https://signup.snowflake.com/
+[Snowpark Python]: https://docs.snowflake.com/en/developer-guide/snowpark/python/index
+[miniconda]: https://docs.conda.io/en/latest/miniconda.html
+[Anaconda]: https://www.anaconda.com/
+[virtualenv]: https://docs.python.org/3/tutorial/venv.html
+
## Create your own Streamlit application
### 1. Setup and Enable Access to Snowflake
From 38df545b4a76d197fbd63ad5ee6a37f0e26af672 Mon Sep 17 00:00:00 2001
From: verena <9377970+vpchung@users.noreply.github.com>
Date: Thu, 6 Feb 2025 11:57:55 -0800
Subject: [PATCH 3/3] offer suggestion for possible error
---
README.md | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 68c56a5..4f7b8cf 100644
--- a/README.md
+++ b/README.md
@@ -59,13 +59,24 @@ Use the contents in `example_secrets.toml` as a syntax guide for how `secrets.to
account name. **Note:** If you use the `Copy account identifier` button it will copy data in the format of `orgname.account_name`, update it to be `orgname-account_name`.
- Test your connection to Snowflake by running the example Streamlit app at the base of this directory. This will launch the application on port 8501, the default port for Streamlit applications.
- ```
- streamlit run app.py
- ```
+ ```
+ streamlit run app.py
+ ```
+
+ If you receive the following error during local deployment:
+
+ ```
+ No active warehouse selected in the current session - Select an active warehouse with the 'use warehouse' command
+ ```
+
+ you may need to designate a default warehouse for your Snowflake account. The simplest way is to log into Snowflake via your web browser, open a new SQL Worksheet, and select a warehouse. You'll then be asked if you want to set this as your default warehouse.
+
+ If the error continues after setting a default warehouse, check with an admin to confirm your user permissions.
> [!CAUTION]
> Do not commit your `secrets.toml` file to your forked repository. Keep your credentials secure and do not expose them to the public.
+
### 2. Build your Queries
Once you've completed the setup above, you can begin working on your SQL queries.