Hi folks,
I have one query, and I am not finding any solution yet.
If Streamlit in Snowflake doesn’t support a Python package, then is there any possible way that I can use that package in Streamlit on Snowflake?
Thanking you
ss
Hi folks,
I have one query, and I am not finding any solution yet.
If Streamlit in Snowflake doesn’t support a Python package, then is there any possible way that I can use that package in Streamlit on Snowflake?
Thanking you
ss
Hello @ss_mohanty,
To my knowledge, Snowflake’s support for external Python packages in the Streamlit integration may be limited compared to running Streamlit in a standalone environment. This limitation is due to the security, compatibility, and performance considerations within Snowflake’s managed service environment.
Here are some approaches to consider:
Hope this helps!
Kind Regards,
Sahir Maharaj
Data Scientist | AI Engineer
P.S. Lets connect on LinkedIn!
➤ Want me to build your solution? Lets chat about how I can assist!
➤ Join my Medium community of 30k readers! Sharing my knowledge about data science and AI
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ 100+ FREE Power BI Themes: Download Now
I have deployed a streamlit native app in snowflake. The issue I am currently facing is, I need third party package which is not available in snowflake.
Approach:
I have .zip the external package and upload to the application stage of native app in streamlit and create a user defined function to use the external package in the streamlit in snowflake.
import snowflake.snowpark.functions as F
# external package path
snowflake_session.add_import('@"TEST_DB"."CODE"."SD"/polars.zip')
@F.udf(func="addpolars", packages=["polars"], replace=True, return_type=str)
def testing():
import polars
return "hello"
testing()
CREATE OR REPLACE FUNCTION addpolars()
RETURNS STRING
LANGUAGE PYTHON
RUNTIME_VERSION = '3.8'
PACKAGES = ('snowflake-snowpark-python')
IMPORTS = ('@SD/polars.zip' )
HANDLER = 'add_polar'
as
$$
def add_polar():
import polars
$$;
could you please help me to fix the issue ?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.