streamlit-nightly 1.53.1.dev20260114__py3-none-any.whl → 1.53.1.dev20260116__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/__init__.py +0 -26
- streamlit/auth_util.py +90 -1
- streamlit/cli_util.py +2 -1
- streamlit/commands/echo.py +2 -2
- streamlit/commands/execution_control.py +1 -1
- streamlit/commands/navigation.py +1 -1
- streamlit/components/types/base_custom_component.py +0 -2
- streamlit/components/v1/custom_component.py +0 -2
- streamlit/components/v2/component_path_utils.py +1 -1
- streamlit/components/v2/manifest_scanner.py +8 -3
- streamlit/components/v2/presentation.py +1 -1
- streamlit/config.py +44 -13
- streamlit/config_util.py +5 -5
- streamlit/dataframe_util.py +5 -5
- streamlit/elements/arrow.py +11 -6
- streamlit/elements/deck_gl_json_chart.py +1 -1
- streamlit/elements/exception.py +4 -2
- streamlit/elements/form.py +1 -1
- streamlit/elements/layouts.py +1 -1
- streamlit/elements/lib/built_in_chart_utils.py +7 -7
- streamlit/elements/lib/column_config_utils.py +6 -6
- streamlit/elements/lib/dialog.py +1 -1
- streamlit/elements/lib/image_utils.py +4 -4
- streamlit/elements/lib/layout_utils.py +1 -1
- streamlit/elements/lib/policies.py +1 -1
- streamlit/elements/lib/streamlit_plotly_theme.py +9 -11
- streamlit/elements/lib/utils.py +1 -1
- streamlit/elements/map.py +6 -6
- streamlit/elements/plotly_chart.py +2 -2
- streamlit/elements/toast.py +1 -1
- streamlit/elements/vega_charts.py +2 -2
- streamlit/elements/widgets/button.py +3 -3
- streamlit/elements/widgets/button_group.py +3 -3
- streamlit/elements/widgets/chat.py +1 -1
- streamlit/elements/widgets/data_editor.py +6 -6
- streamlit/elements/widgets/number_input.py +1 -1
- streamlit/elements/widgets/slider.py +5 -5
- streamlit/elements/widgets/time_widgets.py +91 -10
- streamlit/elements/write.py +1 -1
- streamlit/env_util.py +1 -1
- streamlit/errors.py +0 -14
- streamlit/proto/NewSession_pb2.py +18 -18
- streamlit/proto/NewSession_pb2.pyi +5 -1
- streamlit/runtime/app_session.py +78 -59
- streamlit/runtime/caching/cache_data_api.py +3 -3
- streamlit/runtime/caching/cache_errors.py +0 -2
- streamlit/runtime/caching/cache_resource_api.py +1 -1
- streamlit/runtime/caching/cache_utils.py +2 -2
- streamlit/runtime/caching/hashing.py +1 -3
- streamlit/runtime/caching/storage/cache_storage_protocol.py +0 -3
- streamlit/runtime/connection_factory.py +1 -1
- streamlit/runtime/runtime.py +6 -6
- streamlit/runtime/scriptrunner_utils/exceptions.py +0 -4
- streamlit/runtime/scriptrunner_utils/script_run_context.py +0 -21
- streamlit/runtime/secrets.py +2 -3
- streamlit/runtime/state/query_params.py +0 -19
- streamlit/runtime/state/session_state.py +1 -1
- streamlit/runtime/stats.py +0 -7
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +299 -299
- streamlit/static/static/js/{ErrorOutline.esm.BAZUU4id.js → ErrorOutline.esm.CiSfK8ht.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.C6tTTniR.js → FileDownload.esm.ItNjcEfs.js} +1 -1
- streamlit/static/static/js/{FileHelper.BOHlwlc9.js → FileHelper.xS7f19FE.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.D4lty7rT.js → FormClearHelper.N8_BCinn.js} +1 -1
- streamlit/static/static/js/{InputInstructions.BWw9lhud.js → InputInstructions.CrsdK7CQ.js} +1 -1
- streamlit/static/static/js/Particles.BDlTHC3I.js +1 -0
- streamlit/static/static/js/{ProgressBar.DCHh4N3P.js → ProgressBar.Bk2qeHfS.js} +2 -2
- streamlit/static/static/js/{StreamlitSyntaxHighlighter.BRydQwEj.js → StreamlitSyntaxHighlighter.BcuPrPcw.js} +1 -1
- streamlit/static/static/js/{TableChart.esm.7KFX5I_G.js → TableChart.esm.CP7XPz8I.js} +1 -1
- streamlit/static/static/js/Toolbar.DCJcLwve.js +1 -0
- streamlit/static/static/js/{WidgetLabelHelpIconInline.CzodezAH.js → WidgetLabelHelpIconInline.BPqxu1b-.js} +1 -1
- streamlit/static/static/js/{base-input.Cg7NpsfS.js → base-input.x4muJJ13.js} +4 -4
- streamlit/static/static/js/{checkbox.Bs20OTna.js → checkbox.C5r4AIaH.js} +1 -1
- streamlit/static/static/js/{createDownloadLinkElement.DSqCyu38.js → createDownloadLinkElement.C83kkEeT.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.Ch4SqNfY.js → data-grid-overlay-editor.0sOWm4IB.js} +1 -1
- streamlit/static/static/js/{downloader.Oj5CTGJA.js → downloader.C_6FfoEv.js} +1 -1
- streamlit/static/static/js/{embed.CqzzUq73.js → embed.BnJ6-SK4.js} +14 -14
- streamlit/static/static/js/{es6.CYrlw0Vn.js → es6.44_BWfFd.js} +2 -2
- streamlit/static/static/js/{formatNumber.CT_v8e75.js → formatNumber.DhHZAosz.js} +1 -1
- streamlit/static/static/js/{iconPosition.DPAvXTmd.js → iconPosition.shOoQuRR.js} +1 -1
- streamlit/static/static/js/{iframeResizer.contentWindow.T4DvQsIf.js → iframeResizer.contentWindow.savEE5Vs.js} +1 -1
- streamlit/static/static/js/{index.BoWBzl6h.js → index.AdijUi9Z.js} +1 -1
- streamlit/static/static/js/{index.Dtd5z2rM.js → index.B5HlOnvq.js} +1 -1
- streamlit/static/static/js/{index.MtwRNvlS.js → index.B6ewTTej.js} +1 -1
- streamlit/static/static/js/{index.D7KbBAWb.js → index.B8Of3XXR.js} +1 -1
- streamlit/static/static/js/{index.xCV2qwtw.js → index.BCaCSVj6.js} +1 -1
- streamlit/static/static/js/index.BE7Rhig1.js +1 -0
- streamlit/static/static/js/{index.DL_Ooizi.js → index.BHpLZ7X6.js} +2 -2
- streamlit/static/static/js/{index.BPxuKK0S.js → index.BNvP8E5Q.js} +1 -1
- streamlit/static/static/js/{index.LOA31DFn.js → index.BNzuyXeN.js} +2 -2
- streamlit/static/static/js/{index.Cfe-tCQJ.js → index.BT7o4A9V.js} +1 -1
- streamlit/static/static/js/{index.BZ8xp-w9.js → index.BYY3iuVE.js} +1 -1
- streamlit/static/static/js/index.BZI7jTDf.js +1 -0
- streamlit/static/static/js/{index.CGRIbGGV.js → index.BZXk3Qxq.js} +1 -1
- streamlit/static/static/js/{index.CVXiBeDI.js → index.BhQvq6YD.js} +1 -1
- streamlit/static/static/js/{index.CnXxoVEM.js → index.BkIReLGJ.js} +3 -3
- streamlit/static/static/js/{index.AGYZDQZm.js → index.Bl7SMZUw.js} +1 -1
- streamlit/static/static/js/{index.b-MrPulo.js → index.BqtgAGnG.js} +2 -2
- streamlit/static/static/js/{index.B3HdcUdo.js → index.BwnLQnAk.js} +1 -1
- streamlit/static/static/js/index.C1coXTgf.js +2 -0
- streamlit/static/static/js/{index.DXRGd--0.js → index.C6uOmY9O.js} +1 -1
- streamlit/static/static/js/index.CF88nImM.js +1 -0
- streamlit/static/static/js/{index.B9Oowxt8.js → index.CFlGfFvq.js} +1 -1
- streamlit/static/static/js/{index.wngeYhKj.js → index.CQgiNpC7.js} +1 -1
- streamlit/static/static/js/{index.D84XHt50.js → index.CZJkiRFm.js} +1 -1
- streamlit/static/static/js/index.Ch1TdQMG.js +1 -0
- streamlit/static/static/js/{index.Yj6vcyFD.js → index.Ck2mQvBi.js} +1 -1
- streamlit/static/static/js/{index.DPlPEuq6.js → index.CrD2lwZG.js} +1 -1
- streamlit/static/static/js/index.CySNwKoN.js +2 -0
- streamlit/static/static/js/index.D3LEkXqN.js +1 -0
- streamlit/static/static/js/{index.BTA0d5oq.js → index.D8BQH06Z.js} +1 -1
- streamlit/static/static/js/{index.B8ZZdPqF.js → index.DBtWixG1.js} +1 -1
- streamlit/static/static/js/{index.CVKk1nkB.js → index.DIsNrJpC.js} +1 -1
- streamlit/static/static/js/{index.CPYB1awG.js → index.DO3HICut.js} +1 -1
- streamlit/static/static/js/{index.D6HCANv6.js → index.D_ziFad8.js} +1 -1
- streamlit/static/static/js/{index.BTqav7_K.js → index.Dblsdn8d.js} +1 -1
- streamlit/static/static/js/{index.Dg9k4R8B.js → index.DcdD0ROn.js} +2 -2
- streamlit/static/static/js/{index.tLZuZM89.js → index.DfHm3P22.js} +51 -51
- streamlit/static/static/js/{index.CXVpBAvU.js → index.DiwhD0Ic.js} +46 -46
- streamlit/static/static/js/index.DvZDNiBV.js +11 -0
- streamlit/static/static/js/{index.DQzRwgrT.js → index.HjydQ4bj.js} +1 -1
- streamlit/static/static/js/{index.XHtvnZ0-.js → index.HsxzYHNf.js} +1 -1
- streamlit/static/static/js/{index.DesNeXSA.js → index.SVJGpnpy.js} +1 -1
- streamlit/static/static/js/index.SjKkVSL7.js +1 -0
- streamlit/static/static/js/index.hX8_3tMP.js +1 -0
- streamlit/static/static/js/{index.BEzgNZOm.js → index.jZin0w6_.js} +1 -1
- streamlit/static/static/js/{index.DzldU3Hy.js → index.pQvPlPcA.js} +4 -4
- streamlit/static/static/js/index.pzQTLx9j.js +1 -0
- streamlit/static/static/js/{index.ClFk8x0U.js → index.s44_OVd6.js} +33 -33
- streamlit/static/static/js/{input.CYXuTqoa.js → input.jAD-v9D6.js} +2 -2
- streamlit/static/static/js/{main.BE-siVKv.js → main.Cas0fuOs.js} +1 -1
- streamlit/static/static/js/{memory.V554ztRg.js → memory.ENruL8Qk.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BiUTOXIl.js → number-overlay-editor.DAOTdulh.js} +2 -2
- streamlit/static/static/js/{pandasStylerUtils.Dej3Tstq.js → pandasStylerUtils.DChYgcPq.js} +1 -1
- streamlit/static/static/js/{sandbox.gpd7KGMo.js → sandbox.DWZYRCm0.js} +1 -1
- streamlit/static/static/js/{styled-components.Coj4dr6D.js → styled-components.3lwVqgRW.js} +1 -1
- streamlit/static/static/js/{throttle.gZUdtYp7.js → throttle.DfOW1Cns.js} +1 -1
- streamlit/static/static/js/{timepicker.B-Y4aU15.js → timepicker.CXHgL5f9.js} +1 -1
- streamlit/static/static/js/{toConsumableArray.CcKcKvEd.js → toConsumableArray.DiW0GSDV.js} +1 -1
- streamlit/static/static/js/uniqueId.Dfi3SGKZ.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.D-fc_aIL.js → useBasicWidgetState.DnPEt_f3.js} +1 -1
- streamlit/static/static/js/{useIntlLocale.CY32IeNt.js → useIntlLocale.BZEGSOVD.js} +8 -8
- streamlit/static/static/js/{useTextInputAutoExpand.C0jK7TwF.js → useTextInputAutoExpand.MGVZMqyt.js} +1 -1
- streamlit/static/static/js/useUpdateUiValue.CPl6CEx3.js +1 -0
- streamlit/static/static/js/{useWaveformController.BLEIAIDo.js → useWaveformController.DOpzDyZu.js} +1 -1
- streamlit/static/static/js/{withCalculatedWidth.B3oSlRC0.js → withCalculatedWidth.DgKFTeif.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.Cw_ebNmr.js → withFullScreenWrapper.K1jkwhPu.js} +1 -1
- streamlit/string_util.py +2 -2
- streamlit/testing/v1/element_tree.py +8 -10
- streamlit/type_util.py +2 -2
- streamlit/url_util.py +2 -2
- streamlit/user_info.py +2 -2
- streamlit/util.py +1 -1
- streamlit/watcher/path_watcher.py +1 -1
- streamlit/web/cli.py +1 -4
- streamlit/web/server/app_discovery.py +2 -1
- streamlit/web/server/oauth_authlib_routes.py +14 -42
- streamlit/web/server/server.py +1 -1
- streamlit/web/server/server_util.py +1 -1
- streamlit/web/server/starlette/starlette_auth_routes.py +94 -16
- streamlit/web/server/starlette/starlette_routes.py +9 -3
- streamlit/web/server/starlette/starlette_server.py +2 -2
- {streamlit_nightly-1.53.1.dev20260114.dist-info → streamlit_nightly-1.53.1.dev20260116.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.53.1.dev20260114.dist-info → streamlit_nightly-1.53.1.dev20260116.dist-info}/RECORD +168 -169
- streamlit/commands/experimental_query_params.py +0 -169
- streamlit/static/static/js/Particles.BDi7fIn-.js +0 -1
- streamlit/static/static/js/Toolbar.guIuiwEF.js +0 -1
- streamlit/static/static/js/index.BJnWg9Jq.js +0 -1
- streamlit/static/static/js/index.Bqgt60FU.js +0 -1
- streamlit/static/static/js/index.BsYYrijt.js +0 -11
- streamlit/static/static/js/index.CJQq5LcR.js +0 -2
- streamlit/static/static/js/index.Cw4eSvJ7.js +0 -1
- streamlit/static/static/js/index.DNyw7S7Z.js +0 -1
- streamlit/static/static/js/index.DZDt5hYD.js +0 -1
- streamlit/static/static/js/index.Do9A7QCt.js +0 -1
- streamlit/static/static/js/index.DrSH3pK3.js +0 -2
- streamlit/static/static/js/index.GZi6GTJa.js +0 -1
- streamlit/static/static/js/index.hcUYvTqs.js +0 -1
- streamlit/static/static/js/uniqueId.PRn3V1WU.js +0 -1
- streamlit/static/static/js/useUpdateUiValue.CDQloDgB.js +0 -1
- {streamlit_nightly-1.53.1.dev20260114.data → streamlit_nightly-1.53.1.dev20260116.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.53.1.dev20260114.dist-info → streamlit_nightly-1.53.1.dev20260116.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.53.1.dev20260114.dist-info → streamlit_nightly-1.53.1.dev20260116.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.53.1.dev20260114.dist-info → streamlit_nightly-1.53.1.dev20260116.dist-info}/top_level.txt +0 -0
|
@@ -314,6 +314,7 @@ class CustomThemeConfig(_message.Message):
|
|
|
314
314
|
DATAFRAME_HEADER_BACKGROUND_COLOR_FIELD_NUMBER: _builtins.int
|
|
315
315
|
CHART_CATEGORICAL_COLORS_FIELD_NUMBER: _builtins.int
|
|
316
316
|
CHART_SEQUENTIAL_COLORS_FIELD_NUMBER: _builtins.int
|
|
317
|
+
CHART_DIVERGING_COLORS_FIELD_NUMBER: _builtins.int
|
|
317
318
|
RED_COLOR_FIELD_NUMBER: _builtins.int
|
|
318
319
|
ORANGE_COLOR_FIELD_NUMBER: _builtins.int
|
|
319
320
|
YELLOW_COLOR_FIELD_NUMBER: _builtins.int
|
|
@@ -414,6 +415,8 @@ class CustomThemeConfig(_message.Message):
|
|
|
414
415
|
@_builtins.property
|
|
415
416
|
def chart_sequential_colors(self) -> _containers.RepeatedScalarFieldContainer[_builtins.str]: ...
|
|
416
417
|
@_builtins.property
|
|
418
|
+
def chart_diverging_colors(self) -> _containers.RepeatedScalarFieldContainer[_builtins.str]: ...
|
|
419
|
+
@_builtins.property
|
|
417
420
|
def sidebar(self) -> Global___CustomThemeConfig:
|
|
418
421
|
"""Theme sections:"""
|
|
419
422
|
|
|
@@ -459,6 +462,7 @@ class CustomThemeConfig(_message.Message):
|
|
|
459
462
|
dataframe_header_background_color: _builtins.str | None = ...,
|
|
460
463
|
chart_categorical_colors: _abc.Iterable[_builtins.str] | None = ...,
|
|
461
464
|
chart_sequential_colors: _abc.Iterable[_builtins.str] | None = ...,
|
|
465
|
+
chart_diverging_colors: _abc.Iterable[_builtins.str] | None = ...,
|
|
462
466
|
red_color: _builtins.str | None = ...,
|
|
463
467
|
orange_color: _builtins.str | None = ...,
|
|
464
468
|
yellow_color: _builtins.str | None = ...,
|
|
@@ -486,7 +490,7 @@ class CustomThemeConfig(_message.Message):
|
|
|
486
490
|
) -> None: ...
|
|
487
491
|
_HasFieldArgType: _TypeAlias = _typing.Literal["_base_font_size", b"_base_font_size", "_base_font_weight", b"_base_font_weight", "_base_radius", b"_base_radius", "_blue_background_color", b"_blue_background_color", "_blue_color", b"_blue_color", "_blue_text_color", b"_blue_text_color", "_border_color", b"_border_color", "_button_radius", b"_button_radius", "_code_background_color", b"_code_background_color", "_code_font_size", b"_code_font_size", "_code_font_weight", b"_code_font_weight", "_code_text_color", b"_code_text_color", "_dark", b"_dark", "_dataframe_border_color", b"_dataframe_border_color", "_dataframe_header_background_color", b"_dataframe_header_background_color", "_gray_background_color", b"_gray_background_color", "_gray_color", b"_gray_color", "_gray_text_color", b"_gray_text_color", "_green_background_color", b"_green_background_color", "_green_color", b"_green_color", "_green_text_color", b"_green_text_color", "_light", b"_light", "_link_color", b"_link_color", "_link_underline", b"_link_underline", "_orange_background_color", b"_orange_background_color", "_orange_color", b"_orange_color", "_orange_text_color", b"_orange_text_color", "_red_background_color", b"_red_background_color", "_red_color", b"_red_color", "_red_text_color", b"_red_text_color", "_show_sidebar_border", b"_show_sidebar_border", "_show_widget_border", b"_show_widget_border", "_sidebar", b"_sidebar", "_violet_background_color", b"_violet_background_color", "_violet_color", b"_violet_color", "_violet_text_color", b"_violet_text_color", "_yellow_background_color", b"_yellow_background_color", "_yellow_color", b"_yellow_color", "_yellow_text_color", b"_yellow_text_color", "base_font_size", b"base_font_size", "base_font_weight", b"base_font_weight", "base_radius", b"base_radius", "blue_background_color", b"blue_background_color", "blue_color", b"blue_color", "blue_text_color", b"blue_text_color", "border_color", b"border_color", "button_radius", b"button_radius", "code_background_color", b"code_background_color", "code_font_size", b"code_font_size", "code_font_weight", b"code_font_weight", "code_text_color", b"code_text_color", "dark", b"dark", "dataframe_border_color", b"dataframe_border_color", "dataframe_header_background_color", b"dataframe_header_background_color", "font_sizes", b"font_sizes", "gray_background_color", b"gray_background_color", "gray_color", b"gray_color", "gray_text_color", b"gray_text_color", "green_background_color", b"green_background_color", "green_color", b"green_color", "green_text_color", b"green_text_color", "light", b"light", "link_color", b"link_color", "link_underline", b"link_underline", "orange_background_color", b"orange_background_color", "orange_color", b"orange_color", "orange_text_color", b"orange_text_color", "radii", b"radii", "red_background_color", b"red_background_color", "red_color", b"red_color", "red_text_color", b"red_text_color", "show_sidebar_border", b"show_sidebar_border", "show_widget_border", b"show_widget_border", "sidebar", b"sidebar", "violet_background_color", b"violet_background_color", "violet_color", b"violet_color", "violet_text_color", b"violet_text_color", "yellow_background_color", b"yellow_background_color", "yellow_color", b"yellow_color", "yellow_text_color", b"yellow_text_color"] # noqa: Y015
|
|
488
492
|
def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ...
|
|
489
|
-
_ClearFieldArgType: _TypeAlias = _typing.Literal["_base_font_size", b"_base_font_size", "_base_font_weight", b"_base_font_weight", "_base_radius", b"_base_radius", "_blue_background_color", b"_blue_background_color", "_blue_color", b"_blue_color", "_blue_text_color", b"_blue_text_color", "_border_color", b"_border_color", "_button_radius", b"_button_radius", "_code_background_color", b"_code_background_color", "_code_font_size", b"_code_font_size", "_code_font_weight", b"_code_font_weight", "_code_text_color", b"_code_text_color", "_dark", b"_dark", "_dataframe_border_color", b"_dataframe_border_color", "_dataframe_header_background_color", b"_dataframe_header_background_color", "_gray_background_color", b"_gray_background_color", "_gray_color", b"_gray_color", "_gray_text_color", b"_gray_text_color", "_green_background_color", b"_green_background_color", "_green_color", b"_green_color", "_green_text_color", b"_green_text_color", "_light", b"_light", "_link_color", b"_link_color", "_link_underline", b"_link_underline", "_orange_background_color", b"_orange_background_color", "_orange_color", b"_orange_color", "_orange_text_color", b"_orange_text_color", "_red_background_color", b"_red_background_color", "_red_color", b"_red_color", "_red_text_color", b"_red_text_color", "_show_sidebar_border", b"_show_sidebar_border", "_show_widget_border", b"_show_widget_border", "_sidebar", b"_sidebar", "_violet_background_color", b"_violet_background_color", "_violet_color", b"_violet_color", "_violet_text_color", b"_violet_text_color", "_yellow_background_color", b"_yellow_background_color", "_yellow_color", b"_yellow_color", "_yellow_text_color", b"_yellow_text_color", "background_color", b"background_color", "base", b"base", "base_font_size", b"base_font_size", "base_font_weight", b"base_font_weight", "base_radius", b"base_radius", "blue_background_color", b"blue_background_color", "blue_color", b"blue_color", "blue_text_color", b"blue_text_color", "body_font", b"body_font", "border_color", b"border_color", "button_radius", b"button_radius", "chart_categorical_colors", b"chart_categorical_colors", "chart_sequential_colors", b"chart_sequential_colors", "code_background_color", b"code_background_color", "code_font", b"code_font", "code_font_size", b"code_font_size", "code_font_weight", b"code_font_weight", "code_text_color", b"code_text_color", "dark", b"dark", "dataframe_border_color", b"dataframe_border_color", "dataframe_header_background_color", b"dataframe_header_background_color", "font", b"font", "font_faces", b"font_faces", "font_sizes", b"font_sizes", "font_sources", b"font_sources", "gray_background_color", b"gray_background_color", "gray_color", b"gray_color", "gray_text_color", b"gray_text_color", "green_background_color", b"green_background_color", "green_color", b"green_color", "green_text_color", b"green_text_color", "heading_font", b"heading_font", "heading_font_sizes", b"heading_font_sizes", "heading_font_weights", b"heading_font_weights", "light", b"light", "link_color", b"link_color", "link_underline", b"link_underline", "orange_background_color", b"orange_background_color", "orange_color", b"orange_color", "orange_text_color", b"orange_text_color", "primary_color", b"primary_color", "radii", b"radii", "red_background_color", b"red_background_color", "red_color", b"red_color", "red_text_color", b"red_text_color", "secondary_background_color", b"secondary_background_color", "show_sidebar_border", b"show_sidebar_border", "show_widget_border", b"show_widget_border", "sidebar", b"sidebar", "skeleton_background_color", b"skeleton_background_color", "text_color", b"text_color", "violet_background_color", b"violet_background_color", "violet_color", b"violet_color", "violet_text_color", b"violet_text_color", "widget_background_color", b"widget_background_color", "widget_border_color", b"widget_border_color", "yellow_background_color", b"yellow_background_color", "yellow_color", b"yellow_color", "yellow_text_color", b"yellow_text_color"] # noqa: Y015
|
|
493
|
+
_ClearFieldArgType: _TypeAlias = _typing.Literal["_base_font_size", b"_base_font_size", "_base_font_weight", b"_base_font_weight", "_base_radius", b"_base_radius", "_blue_background_color", b"_blue_background_color", "_blue_color", b"_blue_color", "_blue_text_color", b"_blue_text_color", "_border_color", b"_border_color", "_button_radius", b"_button_radius", "_code_background_color", b"_code_background_color", "_code_font_size", b"_code_font_size", "_code_font_weight", b"_code_font_weight", "_code_text_color", b"_code_text_color", "_dark", b"_dark", "_dataframe_border_color", b"_dataframe_border_color", "_dataframe_header_background_color", b"_dataframe_header_background_color", "_gray_background_color", b"_gray_background_color", "_gray_color", b"_gray_color", "_gray_text_color", b"_gray_text_color", "_green_background_color", b"_green_background_color", "_green_color", b"_green_color", "_green_text_color", b"_green_text_color", "_light", b"_light", "_link_color", b"_link_color", "_link_underline", b"_link_underline", "_orange_background_color", b"_orange_background_color", "_orange_color", b"_orange_color", "_orange_text_color", b"_orange_text_color", "_red_background_color", b"_red_background_color", "_red_color", b"_red_color", "_red_text_color", b"_red_text_color", "_show_sidebar_border", b"_show_sidebar_border", "_show_widget_border", b"_show_widget_border", "_sidebar", b"_sidebar", "_violet_background_color", b"_violet_background_color", "_violet_color", b"_violet_color", "_violet_text_color", b"_violet_text_color", "_yellow_background_color", b"_yellow_background_color", "_yellow_color", b"_yellow_color", "_yellow_text_color", b"_yellow_text_color", "background_color", b"background_color", "base", b"base", "base_font_size", b"base_font_size", "base_font_weight", b"base_font_weight", "base_radius", b"base_radius", "blue_background_color", b"blue_background_color", "blue_color", b"blue_color", "blue_text_color", b"blue_text_color", "body_font", b"body_font", "border_color", b"border_color", "button_radius", b"button_radius", "chart_categorical_colors", b"chart_categorical_colors", "chart_diverging_colors", b"chart_diverging_colors", "chart_sequential_colors", b"chart_sequential_colors", "code_background_color", b"code_background_color", "code_font", b"code_font", "code_font_size", b"code_font_size", "code_font_weight", b"code_font_weight", "code_text_color", b"code_text_color", "dark", b"dark", "dataframe_border_color", b"dataframe_border_color", "dataframe_header_background_color", b"dataframe_header_background_color", "font", b"font", "font_faces", b"font_faces", "font_sizes", b"font_sizes", "font_sources", b"font_sources", "gray_background_color", b"gray_background_color", "gray_color", b"gray_color", "gray_text_color", b"gray_text_color", "green_background_color", b"green_background_color", "green_color", b"green_color", "green_text_color", b"green_text_color", "heading_font", b"heading_font", "heading_font_sizes", b"heading_font_sizes", "heading_font_weights", b"heading_font_weights", "light", b"light", "link_color", b"link_color", "link_underline", b"link_underline", "orange_background_color", b"orange_background_color", "orange_color", b"orange_color", "orange_text_color", b"orange_text_color", "primary_color", b"primary_color", "radii", b"radii", "red_background_color", b"red_background_color", "red_color", b"red_color", "red_text_color", b"red_text_color", "secondary_background_color", b"secondary_background_color", "show_sidebar_border", b"show_sidebar_border", "show_widget_border", b"show_widget_border", "sidebar", b"sidebar", "skeleton_background_color", b"skeleton_background_color", "text_color", b"text_color", "violet_background_color", b"violet_background_color", "violet_color", b"violet_color", "violet_text_color", b"violet_text_color", "widget_background_color", b"widget_background_color", "widget_border_color", b"widget_border_color", "yellow_background_color", b"yellow_background_color", "yellow_color", b"yellow_color", "yellow_text_color", b"yellow_text_color"] # noqa: Y015
|
|
490
494
|
def ClearField(self, field_name: _ClearFieldArgType) -> None: ...
|
|
491
495
|
_WhichOneofReturnType__base_font_size: _TypeAlias = _typing.Literal["base_font_size"] # noqa: Y015
|
|
492
496
|
_WhichOneofArgType__base_font_size: _TypeAlias = _typing.Literal["_base_font_size", b"_base_font_size"] # noqa: Y015
|
streamlit/runtime/app_session.py
CHANGED
|
@@ -53,6 +53,8 @@ from streamlit.watcher import LocalSourcesWatcher
|
|
|
53
53
|
if TYPE_CHECKING:
|
|
54
54
|
from collections.abc import Callable
|
|
55
55
|
|
|
56
|
+
from google.protobuf.internal.containers import RepeatedScalarFieldContainer
|
|
57
|
+
|
|
56
58
|
from streamlit.proto.BackMsg_pb2 import BackMsg, DeferredFileRequest
|
|
57
59
|
from streamlit.runtime.script_data import ScriptData
|
|
58
60
|
from streamlit.runtime.scriptrunner.script_cache import ScriptCache
|
|
@@ -909,7 +911,6 @@ class AppSession:
|
|
|
909
911
|
The actual handler here is a noop
|
|
910
912
|
|
|
911
913
|
"""
|
|
912
|
-
pass
|
|
913
914
|
|
|
914
915
|
def _handle_set_run_on_save_request(self, new_value: bool) -> None:
|
|
915
916
|
"""Change our run_on_save flag to the given value.
|
|
@@ -1016,6 +1017,65 @@ def _populate_config_msg(msg: Config) -> None:
|
|
|
1016
1017
|
msg.toolbar_mode = _get_toolbar_mode()
|
|
1017
1018
|
|
|
1018
1019
|
|
|
1020
|
+
def _parse_and_populate_chart_colors(
|
|
1021
|
+
theme_opts: dict[str, Any],
|
|
1022
|
+
config_key: str,
|
|
1023
|
+
msg_field: RepeatedScalarFieldContainer[str],
|
|
1024
|
+
required_length: int | None = None,
|
|
1025
|
+
) -> None:
|
|
1026
|
+
"""Parse and populate chart colors from theme config to protobuf message field.
|
|
1027
|
+
|
|
1028
|
+
Parameters
|
|
1029
|
+
----------
|
|
1030
|
+
theme_opts
|
|
1031
|
+
Dictionary of theme options from config.get_options_for_section.
|
|
1032
|
+
config_key
|
|
1033
|
+
The key in theme_opts to look for (e.g., "chartCategoricalColors").
|
|
1034
|
+
msg_field
|
|
1035
|
+
The protobuf repeated string field to append colors to.
|
|
1036
|
+
required_length
|
|
1037
|
+
If provided, log an error if the colors array doesn't have this exact length.
|
|
1038
|
+
"""
|
|
1039
|
+
colors = theme_opts.get(config_key)
|
|
1040
|
+
|
|
1041
|
+
# If colors was configured via config.toml, it's already a list of strings.
|
|
1042
|
+
# However, if it was provided via env variable or via CLI arg,
|
|
1043
|
+
# it's a JSON string that needs to be parsed.
|
|
1044
|
+
if isinstance(colors, str):
|
|
1045
|
+
try:
|
|
1046
|
+
colors = json.loads(colors)
|
|
1047
|
+
except json.JSONDecodeError as e:
|
|
1048
|
+
_LOGGER.warning(
|
|
1049
|
+
"Failed to parse the theme.%s config option: %s.",
|
|
1050
|
+
config_key,
|
|
1051
|
+
colors,
|
|
1052
|
+
exc_info=e,
|
|
1053
|
+
)
|
|
1054
|
+
colors = None
|
|
1055
|
+
|
|
1056
|
+
if colors is not None:
|
|
1057
|
+
# Check required length if specified
|
|
1058
|
+
if required_length is not None and len(colors) != required_length:
|
|
1059
|
+
_LOGGER.error(
|
|
1060
|
+
"Config theme.%s should have %s color values, "
|
|
1061
|
+
"but got %s. Defaulting to Streamlit's default colors.",
|
|
1062
|
+
config_key,
|
|
1063
|
+
required_length,
|
|
1064
|
+
len(colors),
|
|
1065
|
+
)
|
|
1066
|
+
return # Don't populate invalid data; let frontend use defaults
|
|
1067
|
+
for color in colors:
|
|
1068
|
+
try:
|
|
1069
|
+
msg_field.append(color)
|
|
1070
|
+
except Exception as e: # noqa: PERF203
|
|
1071
|
+
_LOGGER.warning(
|
|
1072
|
+
"Failed to parse the theme.%s config option: %s.",
|
|
1073
|
+
config_key,
|
|
1074
|
+
color,
|
|
1075
|
+
exc_info=e,
|
|
1076
|
+
)
|
|
1077
|
+
|
|
1078
|
+
|
|
1019
1079
|
def _populate_theme_msg(msg: CustomThemeConfig, section: str = "theme") -> None:
|
|
1020
1080
|
theme_opts = config.get_options_for_section(section)
|
|
1021
1081
|
if all(val is None for val in theme_opts.values()):
|
|
@@ -1036,6 +1096,7 @@ def _populate_theme_msg(msg: CustomThemeConfig, section: str = "theme") -> None:
|
|
|
1036
1096
|
"headingFontWeights",
|
|
1037
1097
|
"chartCategoricalColors",
|
|
1038
1098
|
"chartSequentialColors",
|
|
1099
|
+
"chartDivergingColors",
|
|
1039
1100
|
}
|
|
1040
1101
|
and option_val is not None
|
|
1041
1102
|
):
|
|
@@ -1180,64 +1241,22 @@ def _populate_theme_msg(msg: CustomThemeConfig, section: str = "theme") -> None:
|
|
|
1180
1241
|
exc_info=e,
|
|
1181
1242
|
)
|
|
1182
1243
|
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
for color in chart_categorical_colors:
|
|
1200
|
-
try:
|
|
1201
|
-
msg.chart_categorical_colors.append(color)
|
|
1202
|
-
except Exception as e: # noqa: PERF203
|
|
1203
|
-
_LOGGER.warning(
|
|
1204
|
-
"Failed to parse the theme.chartCategoricalColors config option: %s.",
|
|
1205
|
-
color,
|
|
1206
|
-
exc_info=e,
|
|
1207
|
-
)
|
|
1208
|
-
|
|
1209
|
-
chart_sequential_colors = theme_opts.get("chartSequentialColors", None)
|
|
1210
|
-
# If chartSequentialColors was configured via config.toml, it's already a list of
|
|
1211
|
-
# strings. However, if it was provided via env variable or via CLI arg,
|
|
1212
|
-
# it's a json string that needs to be parsed.
|
|
1213
|
-
if isinstance(chart_sequential_colors, str):
|
|
1214
|
-
try:
|
|
1215
|
-
chart_sequential_colors = json.loads(chart_sequential_colors)
|
|
1216
|
-
except json.JSONDecodeError as e:
|
|
1217
|
-
_LOGGER.warning(
|
|
1218
|
-
"Failed to parse the theme.chartSequentialColors config option: %s.",
|
|
1219
|
-
chart_sequential_colors,
|
|
1220
|
-
exc_info=e,
|
|
1221
|
-
)
|
|
1222
|
-
chart_sequential_colors = None
|
|
1223
|
-
|
|
1224
|
-
if chart_sequential_colors is not None:
|
|
1225
|
-
# Check that the list has 10 color values
|
|
1226
|
-
if len(chart_sequential_colors) != 10:
|
|
1227
|
-
_LOGGER.error(
|
|
1228
|
-
"Config theme.chartSequentialColors should have 10 color values, "
|
|
1229
|
-
"but got %s. Defaulting to Streamlit's default colors.",
|
|
1230
|
-
len(chart_sequential_colors),
|
|
1231
|
-
)
|
|
1232
|
-
for color in chart_sequential_colors:
|
|
1233
|
-
try:
|
|
1234
|
-
msg.chart_sequential_colors.append(color)
|
|
1235
|
-
except Exception as e: # noqa: PERF203
|
|
1236
|
-
_LOGGER.warning(
|
|
1237
|
-
"Failed to parse the theme.chartSequentialColors config option: %s.",
|
|
1238
|
-
color,
|
|
1239
|
-
exc_info=e,
|
|
1240
|
-
)
|
|
1244
|
+
# Handle chart color configurations
|
|
1245
|
+
_parse_and_populate_chart_colors(
|
|
1246
|
+
theme_opts, "chartCategoricalColors", msg.chart_categorical_colors
|
|
1247
|
+
)
|
|
1248
|
+
_parse_and_populate_chart_colors(
|
|
1249
|
+
theme_opts,
|
|
1250
|
+
"chartSequentialColors",
|
|
1251
|
+
msg.chart_sequential_colors,
|
|
1252
|
+
required_length=10,
|
|
1253
|
+
)
|
|
1254
|
+
_parse_and_populate_chart_colors(
|
|
1255
|
+
theme_opts,
|
|
1256
|
+
"chartDivergingColors",
|
|
1257
|
+
msg.chart_diverging_colors,
|
|
1258
|
+
required_length=10,
|
|
1259
|
+
)
|
|
1241
1260
|
|
|
1242
1261
|
|
|
1243
1262
|
def _populate_user_info_msg(msg: UserInfo) -> None:
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
|
-
import pickle
|
|
19
|
+
import pickle # noqa: S403
|
|
20
20
|
import threading
|
|
21
21
|
from typing import (
|
|
22
22
|
TYPE_CHECKING,
|
|
@@ -654,13 +654,13 @@ class CacheDataAPI:
|
|
|
654
654
|
else:
|
|
655
655
|
persist_string = persist
|
|
656
656
|
|
|
657
|
-
if persist_string not in
|
|
657
|
+
if persist_string not in {None, "disk"}:
|
|
658
658
|
# We'll eventually have more persist options.
|
|
659
659
|
raise StreamlitAPIException(
|
|
660
660
|
f"Unsupported persist option '{persist}'. Valid values are 'disk' or None."
|
|
661
661
|
)
|
|
662
662
|
|
|
663
|
-
if scope not in
|
|
663
|
+
if scope not in {"global", "session"}:
|
|
664
664
|
raise StreamlitAPIException(
|
|
665
665
|
f"Unsupported scope option '{scope}'. Valid values are 'global' or 'session'."
|
|
666
666
|
)
|
|
@@ -592,10 +592,10 @@ def _get_positional_arg_name(func: Callable[..., Any], arg_index: int) -> str |
|
|
|
592
592
|
if arg_index >= len(params):
|
|
593
593
|
return None
|
|
594
594
|
|
|
595
|
-
if params[arg_index].kind in
|
|
595
|
+
if params[arg_index].kind in {
|
|
596
596
|
inspect.Parameter.POSITIONAL_OR_KEYWORD,
|
|
597
597
|
inspect.Parameter.POSITIONAL_ONLY,
|
|
598
|
-
|
|
598
|
+
}:
|
|
599
599
|
return params[arg_index].name
|
|
600
600
|
|
|
601
601
|
return None
|
|
@@ -25,7 +25,7 @@ import hashlib
|
|
|
25
25
|
import inspect
|
|
26
26
|
import io
|
|
27
27
|
import os
|
|
28
|
-
import pickle
|
|
28
|
+
import pickle # noqa: S403
|
|
29
29
|
import sys
|
|
30
30
|
import tempfile
|
|
31
31
|
import threading
|
|
@@ -653,5 +653,3 @@ class _CacheFuncHasher:
|
|
|
653
653
|
|
|
654
654
|
class NoResult:
|
|
655
655
|
"""Placeholder class for return values when None is meaningful."""
|
|
656
|
-
|
|
657
|
-
pass
|
|
@@ -156,7 +156,6 @@ class CacheStorage(Protocol):
|
|
|
156
156
|
to close open resources, before we delete the storage instance.
|
|
157
157
|
e.g. close the database connection etc.
|
|
158
158
|
"""
|
|
159
|
-
pass
|
|
160
159
|
|
|
161
160
|
|
|
162
161
|
class CacheStorageManager(Protocol):
|
|
@@ -235,5 +234,3 @@ class CacheStorageManager(Protocol):
|
|
|
235
234
|
-----
|
|
236
235
|
Threading: Should be safe to call from any thread.
|
|
237
236
|
"""
|
|
238
|
-
|
|
239
|
-
pass
|
|
@@ -99,7 +99,7 @@ def _create_connection(
|
|
|
99
99
|
)
|
|
100
100
|
|
|
101
101
|
scope = connection_class.scope()
|
|
102
|
-
if scope not in
|
|
102
|
+
if scope not in {"global", "session"}:
|
|
103
103
|
raise StreamlitAPIException(
|
|
104
104
|
f"Connection class {connection_class} has scope '{scope}'. Valid values "
|
|
105
105
|
"are 'global' or 'session'."
|
streamlit/runtime/runtime.py
CHANGED
|
@@ -345,7 +345,7 @@ class Runtime:
|
|
|
345
345
|
async_objs = self._get_async_objs()
|
|
346
346
|
|
|
347
347
|
def stop_on_eventloop() -> None:
|
|
348
|
-
if self._state in
|
|
348
|
+
if self._state in {RuntimeState.STOPPING, RuntimeState.STOPPED}:
|
|
349
349
|
return
|
|
350
350
|
|
|
351
351
|
_LOGGER.debug("Runtime stopping...")
|
|
@@ -411,7 +411,7 @@ class Runtime:
|
|
|
411
411
|
"This should never happen."
|
|
412
412
|
)
|
|
413
413
|
|
|
414
|
-
if self._state in
|
|
414
|
+
if self._state in {RuntimeState.STOPPING, RuntimeState.STOPPED}:
|
|
415
415
|
raise RuntimeStoppedError(f"Can't connect_session (state={self._state})")
|
|
416
416
|
|
|
417
417
|
session_id = self._session_mgr.connect_session(
|
|
@@ -510,7 +510,7 @@ class Runtime:
|
|
|
510
510
|
-----
|
|
511
511
|
Threading: UNSAFE. Must be called on the eventloop thread.
|
|
512
512
|
"""
|
|
513
|
-
if self._state in
|
|
513
|
+
if self._state in {RuntimeState.STOPPING, RuntimeState.STOPPED}:
|
|
514
514
|
raise RuntimeStoppedError(f"Can't handle_backmsg (state={self._state})")
|
|
515
515
|
|
|
516
516
|
session_info = self._session_mgr.get_active_session_info(session_id)
|
|
@@ -538,7 +538,7 @@ class Runtime:
|
|
|
538
538
|
-----
|
|
539
539
|
Threading: UNSAFE. Must be called on the eventloop thread.
|
|
540
540
|
"""
|
|
541
|
-
if self._state in
|
|
541
|
+
if self._state in {RuntimeState.STOPPING, RuntimeState.STOPPED}:
|
|
542
542
|
raise RuntimeStoppedError(
|
|
543
543
|
f"Can't handle_backmsg_deserialization_exception (state={self._state})"
|
|
544
544
|
)
|
|
@@ -555,11 +555,11 @@ class Runtime:
|
|
|
555
555
|
|
|
556
556
|
@property
|
|
557
557
|
async def is_ready_for_browser_connection(self) -> tuple[bool, str]:
|
|
558
|
-
if self._state not in
|
|
558
|
+
if self._state not in {
|
|
559
559
|
RuntimeState.INITIAL,
|
|
560
560
|
RuntimeState.STOPPING,
|
|
561
561
|
RuntimeState.STOPPED,
|
|
562
|
-
|
|
562
|
+
}:
|
|
563
563
|
return True, "ok"
|
|
564
564
|
|
|
565
565
|
return False, "unavailable"
|
|
@@ -22,14 +22,10 @@ from streamlit.util import repr_
|
|
|
22
22
|
class ScriptControlException(BaseException): # NOSONAR
|
|
23
23
|
"""Base exception for ScriptRunner."""
|
|
24
24
|
|
|
25
|
-
pass
|
|
26
|
-
|
|
27
25
|
|
|
28
26
|
class StopException(ScriptControlException):
|
|
29
27
|
"""Silently stop the execution of the user's script."""
|
|
30
28
|
|
|
31
|
-
pass
|
|
32
|
-
|
|
33
29
|
|
|
34
30
|
class RerunException(ScriptControlException):
|
|
35
31
|
"""Silently stop and rerun the user's script."""
|
|
@@ -28,7 +28,6 @@ from urllib import parse
|
|
|
28
28
|
|
|
29
29
|
from streamlit.errors import (
|
|
30
30
|
NoSessionContext,
|
|
31
|
-
StreamlitAPIException,
|
|
32
31
|
)
|
|
33
32
|
from streamlit.logger import get_logger
|
|
34
33
|
from streamlit.runtime.forward_msg_cache import (
|
|
@@ -109,10 +108,6 @@ class ScriptRunContext:
|
|
|
109
108
|
# we allow only one dialog to be open at the same time
|
|
110
109
|
has_dialog_opened: bool = False
|
|
111
110
|
|
|
112
|
-
# TODO(willhuang1997): Remove this variable when experimental query params are removed
|
|
113
|
-
_experimental_query_params_used = False
|
|
114
|
-
_production_query_params_used = False
|
|
115
|
-
|
|
116
111
|
@property
|
|
117
112
|
def page_script_hash(self) -> str:
|
|
118
113
|
return self.pages_manager.current_page_script_hash
|
|
@@ -202,22 +197,6 @@ class ScriptRunContext:
|
|
|
202
197
|
# Pass the message up to our associated ScriptRunner.
|
|
203
198
|
self._enqueue(msg_to_send)
|
|
204
199
|
|
|
205
|
-
def ensure_single_query_api_used(self) -> None:
|
|
206
|
-
if self._experimental_query_params_used and self._production_query_params_used:
|
|
207
|
-
raise StreamlitAPIException(
|
|
208
|
-
"Using `st.query_params` together with either `st.experimental_get_query_params` "
|
|
209
|
-
"or `st.experimental_set_query_params` is not supported. Please "
|
|
210
|
-
" convert your app to only use `st.query_params`"
|
|
211
|
-
)
|
|
212
|
-
|
|
213
|
-
def mark_experimental_query_params_used(self) -> None:
|
|
214
|
-
self._experimental_query_params_used = True
|
|
215
|
-
self.ensure_single_query_api_used()
|
|
216
|
-
|
|
217
|
-
def mark_production_query_params_used(self) -> None:
|
|
218
|
-
self._production_query_params_used = True
|
|
219
|
-
self.ensure_single_query_api_used()
|
|
220
|
-
|
|
221
200
|
|
|
222
201
|
SCRIPT_RUN_CONTEXT_ATTR_NAME: Final = "streamlit_script_run_ctx"
|
|
223
202
|
|
streamlit/runtime/secrets.py
CHANGED
|
@@ -230,7 +230,6 @@ class Secrets(Mapping[str, Any]):
|
|
|
230
230
|
"""Left in place for compatibility with integrations until integration
|
|
231
231
|
code can be updated.
|
|
232
232
|
"""
|
|
233
|
-
pass
|
|
234
233
|
|
|
235
234
|
def _reset(self) -> None:
|
|
236
235
|
"""Clear the secrets dictionary and remove any secrets that were
|
|
@@ -396,7 +395,7 @@ class Secrets(Mapping[str, Any]):
|
|
|
396
395
|
is a string, int, or float.
|
|
397
396
|
"""
|
|
398
397
|
value_type = type(v)
|
|
399
|
-
if value_type in
|
|
398
|
+
if value_type in {str, int, float}:
|
|
400
399
|
os.environ[k] = str(v)
|
|
401
400
|
|
|
402
401
|
@staticmethod
|
|
@@ -405,7 +404,7 @@ class Secrets(Mapping[str, Any]):
|
|
|
405
404
|
is a string, int, or float.
|
|
406
405
|
"""
|
|
407
406
|
value_type = type(v)
|
|
408
|
-
if value_type in
|
|
407
|
+
if value_type in {str, int, float} and os.environ.get(k) == v:
|
|
409
408
|
del os.environ[k]
|
|
410
409
|
|
|
411
410
|
def _maybe_install_file_watchers(self) -> None:
|
|
@@ -47,8 +47,6 @@ class QueryParams(MutableMapping[str, str]):
|
|
|
47
47
|
_query_params: dict[str, list[str] | str] = field(default_factory=dict)
|
|
48
48
|
|
|
49
49
|
def __iter__(self) -> Iterator[str]:
|
|
50
|
-
self._ensure_single_query_api_used()
|
|
51
|
-
|
|
52
50
|
return iter(
|
|
53
51
|
key
|
|
54
52
|
for key in self._query_params
|
|
@@ -60,7 +58,6 @@ class QueryParams(MutableMapping[str, str]):
|
|
|
60
58
|
Returns the last item in a list or an empty string if empty.
|
|
61
59
|
If the key is not present, raise KeyError.
|
|
62
60
|
"""
|
|
63
|
-
self._ensure_single_query_api_used()
|
|
64
61
|
if key.lower() in EMBED_QUERY_PARAMS_KEYS:
|
|
65
62
|
raise KeyError(missing_key_error_message(key))
|
|
66
63
|
|
|
@@ -77,7 +74,6 @@ class QueryParams(MutableMapping[str, str]):
|
|
|
77
74
|
raise KeyError(missing_key_error_message(key))
|
|
78
75
|
|
|
79
76
|
def __setitem__(self, key: str, value: str | Iterable[str]) -> None:
|
|
80
|
-
self._ensure_single_query_api_used()
|
|
81
77
|
self._set_item_internal(key, value)
|
|
82
78
|
self._send_query_param_msg()
|
|
83
79
|
|
|
@@ -85,7 +81,6 @@ class QueryParams(MutableMapping[str, str]):
|
|
|
85
81
|
_set_item_in_dict(self._query_params, key, value)
|
|
86
82
|
|
|
87
83
|
def __delitem__(self, key: str) -> None:
|
|
88
|
-
self._ensure_single_query_api_used()
|
|
89
84
|
if key.lower() in EMBED_QUERY_PARAMS_KEYS:
|
|
90
85
|
raise KeyError(missing_key_error_message(key))
|
|
91
86
|
try:
|
|
@@ -103,7 +98,6 @@ class QueryParams(MutableMapping[str, str]):
|
|
|
103
98
|
) -> None:
|
|
104
99
|
# This overrides the `update` provided by MutableMapping
|
|
105
100
|
# to ensure only one one ForwardMsg is sent.
|
|
106
|
-
self._ensure_single_query_api_used()
|
|
107
101
|
if hasattr(other, "keys") and hasattr(other, "__getitem__"):
|
|
108
102
|
other = cast("SupportsKeysAndGetItem[str, str | Iterable[str]]", other)
|
|
109
103
|
for key in other.keys(): # noqa: SIM118
|
|
@@ -116,14 +110,12 @@ class QueryParams(MutableMapping[str, str]):
|
|
|
116
110
|
self._send_query_param_msg()
|
|
117
111
|
|
|
118
112
|
def get_all(self, key: str) -> list[str]:
|
|
119
|
-
self._ensure_single_query_api_used()
|
|
120
113
|
if key not in self._query_params or key.lower() in EMBED_QUERY_PARAMS_KEYS:
|
|
121
114
|
return []
|
|
122
115
|
value = self._query_params[key]
|
|
123
116
|
return value if isinstance(value, list) else [value]
|
|
124
117
|
|
|
125
118
|
def __len__(self) -> int:
|
|
126
|
-
self._ensure_single_query_api_used()
|
|
127
119
|
return len(
|
|
128
120
|
{
|
|
129
121
|
key
|
|
@@ -133,14 +125,12 @@ class QueryParams(MutableMapping[str, str]):
|
|
|
133
125
|
)
|
|
134
126
|
|
|
135
127
|
def __str__(self) -> str:
|
|
136
|
-
self._ensure_single_query_api_used()
|
|
137
128
|
return str(self._query_params)
|
|
138
129
|
|
|
139
130
|
def _send_query_param_msg(self) -> None:
|
|
140
131
|
ctx = get_script_run_ctx()
|
|
141
132
|
if ctx is None:
|
|
142
133
|
return
|
|
143
|
-
self._ensure_single_query_api_used()
|
|
144
134
|
|
|
145
135
|
msg = ForwardMsg()
|
|
146
136
|
msg.page_info_changed.query_string = parse.urlencode(
|
|
@@ -150,12 +140,10 @@ class QueryParams(MutableMapping[str, str]):
|
|
|
150
140
|
ctx.enqueue(msg)
|
|
151
141
|
|
|
152
142
|
def clear(self) -> None:
|
|
153
|
-
self._ensure_single_query_api_used()
|
|
154
143
|
self.clear_with_no_forward_msg(preserve_embed=True)
|
|
155
144
|
self._send_query_param_msg()
|
|
156
145
|
|
|
157
146
|
def to_dict(self) -> dict[str, str]:
|
|
158
|
-
self._ensure_single_query_api_used()
|
|
159
147
|
# return the last query param if multiple values are set
|
|
160
148
|
return {
|
|
161
149
|
key: self[key]
|
|
@@ -168,7 +156,6 @@ class QueryParams(MutableMapping[str, str]):
|
|
|
168
156
|
_dict: Iterable[tuple[str, str | Iterable[str]]]
|
|
169
157
|
| SupportsKeysAndGetItem[str, str | Iterable[str]],
|
|
170
158
|
) -> None:
|
|
171
|
-
self._ensure_single_query_api_used()
|
|
172
159
|
old_value = self._query_params.copy()
|
|
173
160
|
self.clear_with_no_forward_msg(preserve_embed=True)
|
|
174
161
|
try:
|
|
@@ -188,12 +175,6 @@ class QueryParams(MutableMapping[str, str]):
|
|
|
188
175
|
if key.lower() in EMBED_QUERY_PARAMS_KEYS and preserve_embed
|
|
189
176
|
}
|
|
190
177
|
|
|
191
|
-
def _ensure_single_query_api_used(self) -> None:
|
|
192
|
-
ctx = get_script_run_ctx()
|
|
193
|
-
if ctx is None:
|
|
194
|
-
return
|
|
195
|
-
ctx.mark_production_query_params_used()
|
|
196
|
-
|
|
197
178
|
|
|
198
179
|
def missing_key_error_message(key: str) -> str:
|
|
199
180
|
return f'st.query_params has no key "{key}".'
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
17
|
import json
|
|
18
|
-
import pickle
|
|
18
|
+
import pickle # noqa: S403
|
|
19
19
|
from collections.abc import Iterator, KeysView, Mapping, MutableMapping, Sequence
|
|
20
20
|
from copy import deepcopy
|
|
21
21
|
from dataclasses import dataclass, field, replace
|
streamlit/runtime/stats.py
CHANGED
|
@@ -44,30 +44,24 @@ class Stat(Protocol):
|
|
|
44
44
|
@property
|
|
45
45
|
def family_name(self) -> str:
|
|
46
46
|
"""The name of the metric family (e.g. 'cache_memory_bytes')."""
|
|
47
|
-
pass
|
|
48
47
|
|
|
49
48
|
@property
|
|
50
49
|
def type(self) -> str:
|
|
51
50
|
"""The OpenMetrics type (e.g. 'gauge', 'counter')."""
|
|
52
|
-
pass
|
|
53
51
|
|
|
54
52
|
@property
|
|
55
53
|
def unit(self) -> str:
|
|
56
54
|
"""The unit of the metric (e.g. 'bytes')."""
|
|
57
|
-
pass
|
|
58
55
|
|
|
59
56
|
@property
|
|
60
57
|
def help(self) -> str:
|
|
61
58
|
"""A description of the metric."""
|
|
62
|
-
pass
|
|
63
59
|
|
|
64
60
|
def to_metric_str(self) -> str:
|
|
65
61
|
"""Convert this stat to an OpenMetrics-formatted string."""
|
|
66
|
-
pass
|
|
67
62
|
|
|
68
63
|
def marshall_metric_proto(self, metric: MetricProto) -> None:
|
|
69
64
|
"""Fill an OpenMetrics `Metric` protobuf object."""
|
|
70
|
-
pass
|
|
71
65
|
|
|
72
66
|
|
|
73
67
|
# TODO(vdonato): Could we use GaugeStat below and get rid of this class?
|
|
@@ -274,7 +268,6 @@ class StatsProvider(Protocol):
|
|
|
274
268
|
The StatsManager uses this property to determine which providers to call
|
|
275
269
|
when specific metric families are requested.
|
|
276
270
|
"""
|
|
277
|
-
pass
|
|
278
271
|
|
|
279
272
|
def get_stats(
|
|
280
273
|
self, family_names: Sequence[str] | None = None
|
streamlit/static/index.html
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<script>
|
|
38
38
|
window.prerenderReady = false
|
|
39
39
|
</script>
|
|
40
|
-
<script type="module" crossorigin src="./static/js/index.
|
|
40
|
+
<script type="module" crossorigin src="./static/js/index.DiwhD0Ic.js"></script>
|
|
41
41
|
<link rel="stylesheet" crossorigin href="./static/css/index.BUP6fTcR.css">
|
|
42
42
|
</head>
|
|
43
43
|
<body>
|