Skip to content

Commit 8beb179

Browse files
feat(SAFE): handle failing toolz import with an error message containing the fix
1 parent 7115d7a commit 8beb179

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

perimeter-security-control/streamlit_app.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@
1010
import streamlit as st
1111
from snowflake.snowpark.context import get_active_session
1212
from streamlit.navigation.page import StreamlitPage
13-
from toolz import pipe
14-
from toolz.curried import do as cdo
15-
from toolz.curried import filter as cfilter
16-
from toolz.curried import map as cmap
17-
from toolz.curried import pluck as cpluck
13+
try:
14+
from toolz import pipe
15+
from toolz.curried import do as cdo
16+
from toolz.curried import filter as cfilter
17+
from toolz.curried import map as cmap
18+
from toolz.curried import pluck as cpluck
19+
except ImportError:
20+
st.error("Could not import `toolz` package. Please make sure it's added to the list of packages in the dropdown.")
21+
st.stop()
1822

1923
st.set_page_config(layout="wide")
2024
# Connection short-circuits in SiS, creating the session immediately

0 commit comments

Comments
 (0)