Hi team
I have this streamlit app published in Snowflake. It has been working fine since published. However, I am getting this warning that the st.connection(''snowpark") will be removed.
When I tried switching from st.connection(“snowpark”) to st.connection(“snowflake”) as suggested in the warning message, I am getting this error:
Error message:
ImportError: cannot import name ‘BAD_REQUEST_GS_CODE’ from ‘snowflake.connector.network’ (/usr/lib/python_udf/9c6deab4ddfeb6ccf4ef50d22ad9d986333cdb8f976bcaf62df77ced42366ee3/lib/python3.8/site-packages/snowflake/connector/network.py)
Traceback:
File "/usr/lib/python_udf/9c6deab4ddfeb6ccf4ef50d22ad9d986333cdb8f976bcaf62df77ced42366ee3/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 540, in _run_script
exec(code, module.__dict__)File "/tmp/appRoot/streamlit_app.py", line 13, in <module>
df = conn.query("SELECT * from TEST_LANDING.HCPTOOL.CLIENT_CONTRIBUTION;", ttl=600)File "/usr/lib/python_udf/9c6deab4ddfeb6ccf4ef50d22ad9d986333cdb8f976bcaf62df77ced42366ee3/lib/python3.8/site-packages/streamlit/connections/snowflake_connection.py", line 169, in query
from snowflake.connector.network import ( # type: ignore[import]
This is the code that I am using to test the new connection:
# streamlit_app.py
import streamlit as st
# Initialize connection.
conn = st.connection("snowflake")
# Perform query.
df = conn.query("SELECT * from TEST_LANDING.HCPTOOL.CLIENT_CONTRIBUTION;", ttl=600)
I can’t seem to find any topic on this. Could you kindly help please?
Many thanks