제한 사항 및 라이브러리 변경 사항¶
이 항목에서는 Streamlit 기능이 오픈 소스 라이브러리와 Snowflake에서 다르게 작동할 때의 제한 사항과 기능 동작 변경에 대해 설명합니다.
To view release notes for each Streamlit version, see Streamlit documentation.
Limitations and changes for all runtimes¶
다음 제한 사항은 런타임 환경에 관계없이 모든 Streamlit in Snowflake 앱에 적용됩니다.
외부 스크립트를 사용한 사용자 지정 구성 요소
Using external stages isn’t supported.
Replication isn’t supported.
Using
.sofiles isn’t supported.
Limitations and changes that vary by runtime¶
다음 테이블에서는 Warehouse Runtime과 Container Runtime(미리 보기) 간에 다른 제한 사항을 비교합니다. 런타임 환경에 대한 자세한 내용은 Streamlit 앱을 위한 런타임 환경 섹션을 참조하세요.
제한 사항 |
Warehouse Runtime |
Container Runtime(미리 보기) |
|---|---|---|
3.9, 3.10, 3.11 |
3.11만 해당 |
|
1.22 이상(제한된 선택) |
1.50 이상( |
|
Not supported |
지원됨 |
|
32 MB |
구성 가능 |
|
200 MB |
구성 가능 |
|
외부 제공 서비스 약관에 동의해야 합니다. |
외부 제공 서비스 약관이 적용되지 않습니다. |
|
단일 세션 캐싱. 캐시된 값은 세션 간에 공유할 수 없습니다. |
완전히 지원됨. 캐시 데코레이터에서 세션 범위 지정을 사용하지 않는 한 캐시된 값은 모든 뷰어 세션에서 공유됩니다. |
|
CREATE STREAMLIT에서 레거시 매개 변수로 지원됩니다. |
Not supported |
|
유지 관리 윈도우 |
해당 없음 |
Snowpark Container Services :ref:`유지 관리 창<label-SPCS_working_with_compute_pool_maintenance_window>`에 따라 적용됩니다. |
정적 파일 제공 |
Not supported |
지원됨 |
제한 사항 세부 정보¶
지원되지 않는 Streamlit 기능¶
The following Streamlit features are not fully supported in Streamlit in Snowflake:
-
The
page_title,page_icon, andmenu_itemsproperties of thest.set_page_configcommand aren’t supported. config.toml파일:지원되는 구성 옵션과 지원되지 않는 구성 옵션에 대한 요약은 Streamlit 구성 섹션을 참조하세요.
Loading external resources¶
모든 Streamlit in Snowflake 앱은 로드할 수 있는 리소스를 제한하는 콘텐츠 보안 정책(CSP) 내에서 실행됩니다. CSP는 외부 도메인에서 코드를 로딩하고 iframe에 외부 콘텐츠를 포함하는 것을 차단합니다. eval()`과 같이 일반적으로 안전하지 않은 것으로 간주되는 프런트엔드 호출도 차단합니다. CSP 에 대한 자세한 내용은 :ref:`label-streamlit_content_security_policy 섹션을 참조하십시오.
예를 들어 다음 코드는 Python 오류 없이 실행되지만 스크립트는 브라우저에서 로딩되거나 실행되지 않습니다.
# This won't work
st.html(
"<script src="http://www.example.com/example.js"></script>",
unsafe_allow_javascript=True
)
참고
앱 개발자는 Snowflake의 공유 책임 모델 에 따라 Streamlit in Snowflake 앱 코드의 보안 검사 및 소프트웨어 공급망에 대한 책임이 있습니다.
사용자 지정 구성 요소¶
CSP의 결과로, 사용자 지정 구성 요소는 Warehouse Runtime 및 Container Runtime의 외부 도메인에서 스크립트를 로드할 수 없습니다. 패키지 기반 구성 요소는 자산 디렉터리를 사용하여 정적 콘텐츠를 제공하므로 다음과 같은 차이점이 적용됩니다.
Warehouse Runtime에서 자산 디렉터리를 활용하는 패키지 기반 v2 구성 요소는 지원되지 않습니다.
Container Runtime에서는 패키지 기반 v2 구성 요소가 완전히 지원됩니다.
Warehouse Runtime에서 v2 사용자 지정 구성 요소를 사용하려면 인라인 HTML, CSS, JavaScript로 정의해야 합니다.
참고
Components imported from a third-party source are subject to the license attached to that component. You are responsible for ensuring that your use of a component is permitted by its license.
Snowflake doesn’t build or maintain third-party components that you might import into Streamlit in Snowflake. Use of such components is at your own risk and is not subject to any warranties, service level agreements, or other similar guarantees by Snowflake.
쿼리 매개 변수¶
For st.query_params in Streamlit in Snowflake, a streamlit- prefix is added to each query parameter key in the URL. This prefix
isn’t included when you use st.query_params to get or set a value.
예를 들어, 다음 URL 을 생각해 보겠습니다.
https://app.snowflake.com/org/account_name/#/streamlit-apps/DB.SCHEMA.APP_NAME?streamlit-first_key=one&streamlit-second_key=two
The parameters in this URL are accessible in st.query_params as the following key-value pairs:
{
"first_key" : "one",
"second_key" : "two"
}
대량의 데이터 표시하기¶
Streamlit apps running in warehouse runtimes have a 32-MB limit on the size of messages exchanged between the backend and the
frontend. If you attempt to display more than 32 MB of data with a single Streamlit command, like st.dataframe, the following error occurs:
MessageSizeError: Data Size exceeds message limit
이 제한을 방지하려면 Streamlit 앱이 32MB 보다 작은 증분 단위로 데이터를 표시하도록 설계합니다. 실행할 수 있는 쿼리의 크기 또는 메모리에 보유할 수 있는 데이터의 양에는 명시적인 제한이 없습니다.
Container Runtime에서 이 제한은 기본적으로 200MB로 설정되며, Streamlit 구성 옵션인 ``server.maxMessageSize``를 설정하여 변경할 수 있습니다. 그러나 메시지 크기는 컨테이너 메모리 용량을 초과할 수 없습니다. 더 큰 메시지를 허용하면 특히 동시 뷰어가 있는 경우 컨테이너의 메모리 제한을 초과할 수 있습니다.
파일 업로드¶
st.file_uploader 및 |st.chat_input|_의 기본 파일 크기 제한은 200MB입니다. Warehouse Runtime에서는 이를 구성할 수 없습니다. Container Runtime에서 이 제한은 Streamlit 구성 옵션인 ``server.maxUploadSize``를 설정하여 변경할 수 있습니다. 그러나 파일 크기는 컨테이너 메모리 용량을 초과할 수 없습니다. 더 큰 파일을 허용하면 특히 동시 뷰어가 있는 경우 컨테이너의 메모리 제한을 초과할 수 있습니다.
더 큰 파일의 경우 데이터를 더 작은 배치로 처리하거나 대체 업로드 방법을 사용하는 것이 좋습니다.
Mapbox 및 Carto¶
Mapbox 및 Carto는 st.map 또는 st.pydeck_chart Streamlit 명령을 사용할 때 맵 타일을 제공합니다.
conda를 사용하여 패키지를 관리하는 Warehouse Runtime에서 Mapbox 및 Carto는 Snowflake의 `외부 제공 서비스 약관<https://www.snowflake.com/legal/external-offering-terms/>`_이 적용되는 서드 파티 애플리케이션입니다.
Warehouse Runtime에서 이러한 명령을 사용하려면 외부 제공 서비스 약관에 동의해야 합니다. Container Runtime에는 이런 동의가 필요하지 않습니다.
캐싱¶
캐싱은 Warehouse Runtime에서 부분적으로 지원되고 Container Runtime에서는 완전히 지원됩니다.
Warehouse Runtime에서 캐싱은 단일 세션 캐싱으로 제한됩니다. 캐시된 값은 세션 간에 공유할 수 없습니다. Container Runtime에서는 캐싱이 완전히 지원됩니다. 캐시된 값은 모든 뷰어 세션에서 공유됩니다.