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.
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.