Spaces:
Sleeping
Sleeping
ravithejak
commited on
Commit
•
0094fda
1
Parent(s):
7bb2832
Update app.py
Browse files
app.py
CHANGED
@@ -10,11 +10,17 @@ icons = {"assistant": "./Snowflake_Logomark_blue.svg", "user": "⛷️"}
|
|
10 |
st.set_page_config(page_title="Snowflake Arctic Enu")
|
11 |
|
12 |
@st.cache_resource
|
13 |
-
def
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
# Replicate Credentials
|
20 |
with st.sidebar:
|
|
|
10 |
st.set_page_config(page_title="Snowflake Arctic Enu")
|
11 |
|
12 |
@st.cache_resource
|
13 |
+
def connect_snowflake():
|
14 |
+
"""
|
15 |
+
Function establish the snowflake connections
|
16 |
+
@st.cache_resource --> run the function only once
|
17 |
+
:return:
|
18 |
+
"""
|
19 |
+
try:
|
20 |
+
print("Connecting to snowflake")
|
21 |
+
return snowflake.connector.connect(**st.secrets["snowflake"])
|
22 |
+
except Exception as snf_error:
|
23 |
+
print(snf_error)
|
24 |
|
25 |
# Replicate Credentials
|
26 |
with st.sidebar:
|