Limitations and unsupported features

This topic describes the following limitations on Streamlit in Snowflake:

Unsupported Streamlit features

The following Streamlit features are not supported in Streamlit in Snowflake:

Limitations when loading external resources in Streamlit in Snowflake

All Streamlit in Snowflake apps run within the Content Security Policy (CSP) that restricts which resources can be loaded. Snowflake blocks loading code from any external domain, including scripts, styles, fonts, and iframe embedding. However, loading a subset of resources from Mapbox is supported.

When you use the st.map or st.pydeck_chart Streamlit commands, Mapbox provides the map tiles when rendering map content. Mapbox is a third-party application and is subject to Snowflake’s External Offerings Terms.

Loading images or media from external domains is supported in Streamlit in Snowflake, but not in the Snowflake Native App Framework.

For example, the following code runs without a Python error, but the script does not load or execute in the browser:

# This will not work
import streamlit.components.v1 as components
components.html("""
<script src="http://www.example.com/example.js"></script>
""", height=0)
Copy

The CSP also blocks front-end calls that are generally considered unsafe, such as eval().

Note

App developers are responsible for security checks and software supply chain of Streamlit in Snowflake app code per the Snowflake’s Shared Responsibility Model.

Additional Streamlit in Snowflake limitations

Streamlit in Snowflake has the following additional limitations:

Streamlit apps have a limit for retrieving data

Streamlit apps running in Streamlit in Snowflake and in a Snowflake Native App have a 32MB limit on the amount of data that can be retrieved from a single query. Queries that exceed 32MB throw the following error:

MessageSizeError: Data Size exceeds message limit

To avoid this limit, design your Streamlit apps to retrieve data in increments smaller than 32MB.

The Streamlit in Snowflake editor does not support stages with server-side encryption

The Streamlit in Snowflake editor does not support creating a STREAMLIT object from files on a named stage that uses server-side encryption. In this situation, Snowsight returns an error.

Streamlit in Snowflake only supports internal stages that use client-side encryption.

st.cache_data and st.cache_resource are not fully supported

st.cache_data and st.cache_resource are not fully supported in Streamlit in Snowflake. Caching only works within a single session. Cached values can’t be carried over to other sessions and shared between different users of a Streamlit app.

Multi-page Streamlit apps are supported with some considerations

Multi-page Streamlit apps are supported with the following considerations:

  • Multi-page Streamlit apps can only be created by using SQL commands. See Create and deploy Streamlit apps using SQL.

  • Individual page URLs are not supported.

  • Files uploaded to the /pages directory are visible within the ROOT_LOCATION of the named stage.