streamlit 1.50.0__py3-none-any.whl → 1.52.0__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 +5 -1
- streamlit/commands/execution_control.py +89 -14
- streamlit/commands/navigation.py +4 -6
- streamlit/commands/page_config.py +4 -6
- streamlit/components/v1/component_arrow.py +7 -7
- streamlit/components/v2/__init__.py +514 -0
- streamlit/components/v2/bidi_component/__init__.py +20 -0
- streamlit/components/v2/bidi_component/constants.py +29 -0
- streamlit/components/v2/bidi_component/main.py +534 -0
- streamlit/components/v2/bidi_component/serialization.py +272 -0
- streamlit/components/v2/bidi_component/state.py +92 -0
- streamlit/components/v2/component_definition_resolver.py +143 -0
- streamlit/components/v2/component_file_watcher.py +403 -0
- streamlit/components/v2/component_manager.py +439 -0
- streamlit/components/v2/component_manifest_handler.py +122 -0
- streamlit/components/v2/component_path_utils.py +245 -0
- streamlit/components/v2/component_registry.py +426 -0
- streamlit/components/v2/get_bidi_component_manager.py +51 -0
- streamlit/components/v2/manifest_scanner.py +615 -0
- streamlit/components/v2/presentation.py +198 -0
- streamlit/components/v2/types.py +324 -0
- streamlit/config.py +456 -53
- streamlit/config_option.py +4 -1
- streamlit/config_util.py +650 -1
- streamlit/connections/snowflake_connection.py +1 -1
- streamlit/connections/snowpark_connection.py +1 -1
- streamlit/dataframe_util.py +33 -26
- streamlit/delta_generator.py +13 -4
- streamlit/delta_generator_singletons.py +11 -15
- streamlit/deprecation_util.py +17 -6
- streamlit/elements/alert.py +16 -0
- streamlit/elements/arrow.py +68 -10
- streamlit/elements/bokeh_chart.py +10 -78
- streamlit/elements/code.py +2 -2
- streamlit/elements/deck_gl_json_chart.py +98 -40
- streamlit/elements/dialog_decorator.py +2 -1
- streamlit/elements/exception.py +4 -2
- streamlit/elements/form.py +27 -0
- streamlit/elements/graphviz_chart.py +1 -3
- streamlit/elements/heading.py +63 -10
- streamlit/elements/html.py +13 -2
- streamlit/elements/image.py +3 -5
- streamlit/elements/layouts.py +59 -33
- streamlit/elements/lib/built_in_chart_utils.py +50 -19
- streamlit/elements/lib/color_util.py +9 -19
- streamlit/elements/lib/column_config_utils.py +9 -12
- streamlit/elements/lib/column_types.py +40 -12
- streamlit/elements/lib/dialog.py +2 -2
- streamlit/elements/lib/image_utils.py +3 -5
- streamlit/elements/lib/layout_utils.py +100 -13
- streamlit/elements/lib/mutable_status_container.py +2 -2
- streamlit/elements/lib/options_selector_utils.py +2 -2
- streamlit/elements/lib/pandas_styler_utils.py +17 -9
- streamlit/elements/lib/shortcut_utils.py +152 -0
- streamlit/elements/lib/utils.py +4 -4
- streamlit/elements/map.py +80 -37
- streamlit/elements/markdown.py +50 -3
- streamlit/elements/media.py +5 -7
- streamlit/elements/metric.py +34 -6
- streamlit/elements/pdf.py +2 -4
- streamlit/elements/plotly_chart.py +197 -20
- streamlit/elements/progress.py +2 -4
- streamlit/elements/space.py +113 -0
- streamlit/elements/spinner.py +1 -1
- streamlit/elements/text.py +20 -3
- streamlit/elements/toast.py +2 -0
- streamlit/elements/vega_charts.py +356 -149
- streamlit/elements/widgets/audio_input.py +12 -11
- streamlit/elements/widgets/button.py +280 -43
- streamlit/elements/widgets/button_group.py +60 -9
- streamlit/elements/widgets/camera_input.py +3 -5
- streamlit/elements/widgets/chat.py +307 -43
- streamlit/elements/widgets/color_picker.py +8 -1
- streamlit/elements/widgets/data_editor.py +88 -44
- streamlit/elements/widgets/file_uploader.py +9 -11
- streamlit/elements/widgets/multiselect.py +4 -3
- streamlit/elements/widgets/number_input.py +4 -4
- streamlit/elements/widgets/radio.py +10 -3
- streamlit/elements/widgets/select_slider.py +8 -5
- streamlit/elements/widgets/selectbox.py +6 -3
- streamlit/elements/widgets/slider.py +38 -42
- streamlit/elements/widgets/text_widgets.py +2 -0
- streamlit/elements/widgets/time_widgets.py +587 -21
- streamlit/elements/write.py +27 -6
- streamlit/emojis.py +1 -1
- streamlit/errors.py +137 -0
- streamlit/git_util.py +1 -1
- streamlit/hello/hello.py +8 -0
- streamlit/hello/utils.py +2 -1
- streamlit/material_icon_names.py +1 -1
- streamlit/navigation/page.py +11 -1
- streamlit/net_util.py +2 -2
- streamlit/proto/Alert_pb2.pyi +3 -3
- streamlit/proto/AppPage_pb2.pyi +7 -1
- streamlit/proto/ArrowData_pb2.py +27 -0
- streamlit/proto/ArrowData_pb2.pyi +52 -0
- streamlit/proto/ArrowNamedDataSet_pb2.pyi +7 -1
- streamlit/proto/ArrowVegaLiteChart_pb2.pyi +7 -1
- streamlit/proto/Arrow_pb2.py +10 -10
- streamlit/proto/Arrow_pb2.pyi +19 -12
- streamlit/proto/AudioInput_pb2.pyi +7 -1
- streamlit/proto/Audio_pb2.pyi +7 -1
- streamlit/proto/AuthRedirect_pb2.pyi +7 -1
- streamlit/proto/AutoRerun_pb2.pyi +7 -1
- streamlit/proto/BackMsg_pb2.py +4 -2
- streamlit/proto/BackMsg_pb2.pyi +34 -4
- streamlit/proto/Balloons_pb2.pyi +7 -1
- streamlit/proto/BidiComponent_pb2.py +34 -0
- streamlit/proto/BidiComponent_pb2.pyi +159 -0
- streamlit/proto/Block_pb2.py +7 -7
- streamlit/proto/Block_pb2.pyi +39 -36
- streamlit/proto/BokehChart_pb2.pyi +7 -1
- streamlit/proto/ButtonGroup_pb2.pyi +9 -9
- streamlit/proto/Button_pb2.py +2 -2
- streamlit/proto/Button_pb2.pyi +11 -2
- streamlit/proto/CameraInput_pb2.pyi +7 -1
- streamlit/proto/ChatInput_pb2.py +6 -6
- streamlit/proto/ChatInput_pb2.pyi +18 -6
- streamlit/proto/Checkbox_pb2.pyi +3 -3
- streamlit/proto/ClientState_pb2.pyi +10 -4
- streamlit/proto/Code_pb2.pyi +7 -1
- streamlit/proto/ColorPicker_pb2.pyi +7 -1
- streamlit/proto/Common_pb2.py +3 -3
- streamlit/proto/Common_pb2.pyi +35 -23
- streamlit/proto/Components_pb2.pyi +19 -13
- streamlit/proto/DataFrame_pb2.pyi +55 -49
- streamlit/proto/DateInput_pb2.pyi +7 -1
- streamlit/proto/DateTimeInput_pb2.py +28 -0
- streamlit/proto/DateTimeInput_pb2.pyi +92 -0
- streamlit/proto/DeckGlJsonChart_pb2.py +10 -4
- streamlit/proto/DeckGlJsonChart_pb2.pyi +12 -6
- streamlit/proto/Delta_pb2.pyi +7 -1
- streamlit/proto/DocString_pb2.pyi +10 -4
- streamlit/proto/DownloadButton_pb2.py +2 -2
- streamlit/proto/DownloadButton_pb2.pyi +16 -2
- streamlit/proto/Element_pb2.py +7 -3
- streamlit/proto/Element_pb2.pyi +33 -5
- streamlit/proto/Empty_pb2.pyi +7 -1
- streamlit/proto/Exception_pb2.pyi +7 -1
- streamlit/proto/Favicon_pb2.pyi +7 -1
- streamlit/proto/FileUploader_pb2.pyi +7 -1
- streamlit/proto/ForwardMsg_pb2.py +12 -10
- streamlit/proto/ForwardMsg_pb2.pyi +42 -15
- streamlit/proto/GapSize_pb2.pyi +4 -4
- streamlit/proto/GitInfo_pb2.pyi +3 -3
- streamlit/proto/GraphVizChart_pb2.pyi +7 -1
- streamlit/proto/Heading_pb2.pyi +7 -1
- streamlit/proto/HeightConfig_pb2.py +2 -2
- streamlit/proto/HeightConfig_pb2.pyi +13 -4
- streamlit/proto/Html_pb2.py +2 -2
- streamlit/proto/Html_pb2.pyi +11 -2
- streamlit/proto/IFrame_pb2.pyi +7 -1
- streamlit/proto/Image_pb2.pyi +10 -4
- streamlit/proto/Json_pb2.pyi +7 -1
- streamlit/proto/LabelVisibilityMessage_pb2.pyi +3 -3
- streamlit/proto/LinkButton_pb2.py +2 -2
- streamlit/proto/LinkButton_pb2.pyi +15 -2
- streamlit/proto/Logo_pb2.pyi +7 -1
- streamlit/proto/Markdown_pb2.pyi +3 -3
- streamlit/proto/Metric_pb2.pyi +7 -7
- streamlit/proto/MetricsEvent_pb2.pyi +10 -4
- streamlit/proto/MultiSelect_pb2.pyi +7 -1
- streamlit/proto/NamedDataSet_pb2.pyi +7 -1
- streamlit/proto/Navigation_pb2.pyi +3 -3
- streamlit/proto/NewSession_pb2.py +18 -18
- streamlit/proto/NewSession_pb2.pyi +59 -40
- streamlit/proto/NumberInput_pb2.pyi +3 -3
- streamlit/proto/PageConfig_pb2.pyi +7 -7
- streamlit/proto/PageInfo_pb2.pyi +7 -1
- streamlit/proto/PageLink_pb2.py +2 -2
- streamlit/proto/PageLink_pb2.pyi +11 -2
- streamlit/proto/PageNotFound_pb2.pyi +7 -1
- streamlit/proto/PageProfile_pb2.pyi +13 -7
- streamlit/proto/PagesChanged_pb2.pyi +7 -1
- streamlit/proto/ParentMessage_pb2.pyi +7 -1
- streamlit/proto/PlotlyChart_pb2.py +8 -6
- streamlit/proto/PlotlyChart_pb2.pyi +9 -7
- streamlit/proto/Progress_pb2.pyi +7 -1
- streamlit/proto/Radio_pb2.pyi +7 -1
- streamlit/proto/RootContainer_pb2.pyi +1 -1
- streamlit/proto/Selectbox_pb2.pyi +7 -1
- streamlit/proto/SessionEvent_pb2.pyi +7 -1
- streamlit/proto/SessionStatus_pb2.pyi +7 -1
- streamlit/proto/Skeleton_pb2.pyi +3 -3
- streamlit/proto/Slider_pb2.pyi +5 -5
- streamlit/proto/Snow_pb2.pyi +7 -1
- streamlit/proto/Space_pb2.py +27 -0
- streamlit/proto/Space_pb2.pyi +48 -0
- streamlit/proto/Spinner_pb2.pyi +7 -1
- streamlit/proto/TextAlignmentConfig_pb2.py +29 -0
- streamlit/proto/TextAlignmentConfig_pb2.pyi +68 -0
- streamlit/proto/TextArea_pb2.pyi +7 -1
- streamlit/proto/TextInput_pb2.pyi +3 -3
- streamlit/proto/Text_pb2.pyi +7 -1
- streamlit/proto/TimeInput_pb2.pyi +7 -1
- streamlit/proto/Toast_pb2.pyi +7 -1
- streamlit/proto/VegaLiteChart_pb2.pyi +7 -1
- streamlit/proto/Video_pb2.pyi +6 -6
- streamlit/proto/WidgetStates_pb2.py +2 -2
- streamlit/proto/WidgetStates_pb2.pyi +23 -7
- streamlit/proto/WidthConfig_pb2.py +2 -2
- streamlit/proto/WidthConfig_pb2.pyi +13 -4
- streamlit/proto/openmetrics_data_model_pb2.pyi +52 -52
- streamlit/runtime/app_session.py +65 -2
- streamlit/runtime/caching/cache_data_api.py +5 -5
- streamlit/runtime/caching/cache_errors.py +4 -1
- streamlit/runtime/caching/cache_resource_api.py +5 -4
- streamlit/runtime/caching/cache_utils.py +3 -2
- streamlit/runtime/caching/cached_message_replay.py +3 -3
- streamlit/runtime/caching/hashing.py +4 -5
- streamlit/runtime/caching/legacy_cache_api.py +2 -1
- streamlit/runtime/connection_factory.py +1 -3
- streamlit/runtime/download_data_util.py +53 -0
- streamlit/runtime/forward_msg_queue.py +5 -1
- streamlit/runtime/fragment.py +2 -1
- streamlit/runtime/media_file_manager.py +178 -2
- streamlit/runtime/memory_media_file_storage.py +1 -1
- streamlit/runtime/metrics_util.py +91 -3
- streamlit/runtime/runtime.py +14 -0
- streamlit/runtime/scriptrunner/exec_code.py +2 -1
- streamlit/runtime/scriptrunner/script_runner.py +5 -3
- streamlit/runtime/scriptrunner_utils/script_run_context.py +3 -6
- streamlit/runtime/secrets.py +2 -4
- streamlit/runtime/session_manager.py +3 -1
- streamlit/runtime/state/common.py +30 -5
- streamlit/runtime/state/presentation.py +85 -0
- streamlit/runtime/state/query_params.py +80 -29
- streamlit/runtime/state/safe_session_state.py +2 -2
- streamlit/runtime/state/session_state.py +221 -17
- streamlit/runtime/state/widgets.py +19 -3
- streamlit/runtime/websocket_session_manager.py +3 -1
- streamlit/source_util.py +2 -2
- streamlit/static/index.html +2 -2
- streamlit/static/manifest.json +557 -239
- streamlit/static/static/css/{index.CIiu7Ygf.css → index.BpABIXK9.css} +1 -1
- streamlit/static/static/css/index.DgR7E2CV.css +1 -0
- streamlit/static/static/js/{ErrorOutline.esm.DUpR0_Ka.js → ErrorOutline.esm.ZJDbmVTx.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.CN4j9-1w.js → FileDownload.esm.Dx0vI3vH.js} +1 -1
- streamlit/static/static/js/{FileHelper.CaIUKG91.js → FileHelper.B7Ero7qQ.js} +3 -3
- streamlit/static/static/js/{FormClearHelper.DTcdrasw.js → FormClearHelper.CG2XN1_g.js} +1 -1
- streamlit/static/static/js/IFrameUtil.DefezniK.js +1 -0
- streamlit/static/static/js/InputInstructions.Cj5-1zf6.js +1 -0
- streamlit/static/static/js/Particles.BfWfv0Aw.js +1 -0
- streamlit/static/static/js/{ProgressBar.DetlP5aY.js → ProgressBar.CGQ8OgfO.js} +2 -2
- streamlit/static/static/js/StreamlitSyntaxHighlighter.DTKLpwhl.js +20 -0
- streamlit/static/static/js/{Toolbar.C77ar7rq.js → Toolbar.B2qFUmd9.js} +1 -1
- streamlit/static/static/js/_arrayIncludes.B19Iyn2B.js +1 -0
- streamlit/static/static/js/_baseIndexOf.BTknn6Gb.js +1 -0
- streamlit/static/static/js/{base-input.BQft14La.js → base-input.o9tL8MDP.js} +4 -4
- streamlit/static/static/js/{checkbox.yZOfXCeX.js → checkbox.0BeV1IBL.js} +1 -1
- streamlit/static/static/js/{createSuper.Dh9w1cs8.js → createSuper.RBO59fEm.js} +1 -1
- streamlit/static/static/js/data-grid-overlay-editor.CiTkUy0t.js +1 -0
- streamlit/static/static/js/{downloader.MeHtkq8r.js → downloader.DwNZg3Mw.js} +1 -1
- streamlit/static/static/js/embed.XT9xNd3F.js +195 -0
- streamlit/static/static/js/{es6.VpBPGCnM.js → es6.x9KsYQg-.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.yMw_ARIL.js → iframeResizer.contentWindow.ZVXpMPi0.js} +1 -1
- streamlit/static/static/js/index.5VPOamri.js +1 -0
- streamlit/static/static/js/index.8HslT92O.js +14 -0
- streamlit/static/static/js/index.AnXMIBz3.js +7 -0
- streamlit/static/static/js/index.B0yp3bM1.js +6 -0
- streamlit/static/static/js/index.B1fRb5wF.js +1 -0
- streamlit/static/static/js/index.B527JZdO.js +3 -0
- streamlit/static/static/js/index.BHgV-yW4.js +1 -0
- streamlit/static/static/js/index.BQr-XwGV.js +1 -0
- streamlit/static/static/js/index.BTtmaLDB.js +1 -0
- streamlit/static/static/js/index.BWB_91TA.js +1 -0
- streamlit/static/static/js/index.BfEKaEmw.js +1 -0
- streamlit/static/static/js/index.BfXjTO8b.js +1 -0
- streamlit/static/static/js/index.Bjy4NRu9.js +3 -0
- streamlit/static/static/js/index.Bu5JWpT_.js +1 -0
- streamlit/static/static/js/index.BuCx76ZV.js +1 -0
- streamlit/static/static/js/index.BxjzhVUb.js +2 -0
- streamlit/static/static/js/index.By55VdPY.js +1 -0
- streamlit/static/static/js/index.CF5MxTbK.js +1 -0
- streamlit/static/static/js/index.CLmq_z9K.js +1 -0
- streamlit/static/static/js/index.CNH4rdSz.js +1 -0
- streamlit/static/static/js/{index.B0H9IXUJ.js → index.CTgm_-jO.js} +10 -41
- streamlit/static/static/js/index.C_rK-Swb.js +188 -0
- streamlit/static/static/js/index.CjozwSzS.js +1 -0
- streamlit/static/static/js/{index.CH1tqnSs.js → index.CkGVt6-G.js} +1 -1
- streamlit/static/static/js/index.CuvXOyER.js +2 -0
- streamlit/static/static/js/{index.FFOzOWzC.js → index.CyUHWoCC.js} +2 -2
- streamlit/static/static/js/index.CyroQtI4.js +2 -0
- streamlit/static/static/js/index.D6HmkoDm.js +263 -0
- streamlit/static/static/js/index.DAqCNvsO.js +1 -0
- streamlit/static/static/js/index.DB_w_CZQ.js +1 -0
- streamlit/static/static/js/index.DBalctjj.js +2 -0
- streamlit/static/static/js/index.DK0RFJUG.js +11 -0
- streamlit/static/static/js/index.DMxc2XFp.js +151 -0
- streamlit/static/static/js/index.DO5utP74.js +2 -0
- streamlit/static/static/js/index.DS7lf09n.js +1 -0
- streamlit/static/static/js/index.DWexTVLY.js +1 -0
- streamlit/static/static/js/index.DXxnU5ej.js +1 -0
- streamlit/static/static/js/index.DcU3uDvB.js +2 -0
- streamlit/static/static/js/index.DlltaH7J.js +1 -0
- streamlit/static/static/js/index.DpNTZz82.js +27 -0
- streamlit/static/static/js/index.Dr9HIhQw.js +1 -0
- streamlit/static/static/js/index.DsgAU5lc.js +1 -0
- streamlit/static/static/js/{index.64ejlaaT.js → index.KfXqjDYy.js} +1 -1
- streamlit/static/static/js/index.PaidgjCs.js +1 -0
- streamlit/static/static/js/index.RJZuWCGA.js +1 -0
- streamlit/static/static/js/{index.Ctn27_AE.js → index.hbeqcRTn.js} +53 -122
- streamlit/static/static/js/index.q5hIQwAY.js +1 -0
- streamlit/static/static/js/index.rORSX6IW.js +1 -0
- streamlit/static/static/js/index.uSX757_v.js +1 -0
- streamlit/static/static/js/index.x_QRaLMd.js +1 -0
- streamlit/static/static/js/{input.s6pjQ49A.js → input.D5oh9-aB.js} +2 -2
- streamlit/static/static/js/main.q9oGOg0H.js +13 -0
- streamlit/static/static/js/{memory.Cuvsdfrl.js → memory.5kCSFUJS.js} +1 -1
- streamlit/static/static/js/moment.C3j7ZXd7.js +4 -0
- streamlit/static/static/js/number-overlay-editor.Cn_LsK8N.js +9 -0
- streamlit/static/static/js/pandasStylerUtils.BqhXt51_.js +1 -0
- streamlit/static/static/js/{possibleConstructorReturn.CqidKeei.js → possibleConstructorReturn.DD9NK1Z8.js} +1 -1
- streamlit/static/static/js/record.B-tDciZb.js +1 -0
- streamlit/static/static/js/{sandbox.CCQREcJx.js → sandbox.DACSyz29.js} +1 -1
- streamlit/static/static/js/styled-components.C3R090At.js +1 -0
- streamlit/static/static/js/threshold.Q1mXg5rX.js +1 -0
- streamlit/static/static/js/throttle.B0GR3Iyz.js +1 -0
- streamlit/static/static/js/{timepicker.mkJF97Bb.js → timepicker.BdhzPxrv.js} +1 -1
- streamlit/static/static/js/timer.C2hYhUse.js +1 -0
- streamlit/static/static/js/{toConsumableArray.De7I7KVR.js → toConsumableArray.Db2pdqM2.js} +1 -1
- streamlit/static/static/js/uniqueId.CtqIr-Yh.js +1 -0
- streamlit/static/static/js/urls.BwSlolu9.js +1 -0
- streamlit/static/static/js/{useBasicWidgetState.CedkNjUW.js → useBasicWidgetState.Bfp6TnSw.js} +1 -1
- streamlit/static/static/js/useIntlLocale.hRV75Xgj.js +12 -0
- streamlit/static/static/js/{useTextInputAutoExpand.Ca7w8dVs.js → useTextInputAutoExpand.QepX7n8Y.js} +1 -1
- streamlit/static/static/js/useUpdateUiValue.DHx8TzX6.js +1 -0
- streamlit/static/static/js/useWaveformController.WxVzpzEX.js +1 -0
- streamlit/static/static/js/value.B4vHRSi7.js +1 -0
- streamlit/static/static/js/wavesurfer.esm.vI8Eid4k.js +73 -0
- streamlit/static/static/js/withCalculatedWidth.DcKeRSWJ.js +1 -0
- streamlit/static/static/js/withFullScreenWrapper.CrHddARq.js +1 -0
- streamlit/static/static/media/MaterialSymbols-Rounded.C7IFxh57.woff2 +0 -0
- streamlit/string_util.py +9 -4
- streamlit/testing/v1/app_test.py +17 -2
- streamlit/testing/v1/element_tree.py +85 -9
- streamlit/testing/v1/util.py +2 -2
- streamlit/type_util.py +3 -4
- streamlit/url_util.py +1 -3
- streamlit/user_info.py +1 -2
- streamlit/util.py +3 -1
- streamlit/watcher/event_based_path_watcher.py +23 -12
- streamlit/watcher/local_sources_watcher.py +11 -1
- streamlit/watcher/path_watcher.py +9 -6
- streamlit/watcher/polling_path_watcher.py +4 -1
- streamlit/watcher/util.py +2 -2
- streamlit/web/bootstrap.py +24 -0
- streamlit/web/cli.py +51 -22
- streamlit/web/server/bidi_component_request_handler.py +193 -0
- streamlit/web/server/component_file_utils.py +97 -0
- streamlit/web/server/component_request_handler.py +8 -21
- streamlit/web/server/oauth_authlib_routes.py +5 -2
- streamlit/web/server/oidc_mixin.py +3 -1
- streamlit/web/server/routes.py +2 -2
- streamlit/web/server/server.py +9 -0
- streamlit/web/server/server_util.py +3 -1
- streamlit/web/server/upload_file_request_handler.py +19 -1
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/METADATA +10 -7
- streamlit-1.52.0.dist-info/RECORD +620 -0
- streamlit/static/static/css/index.CHEnSPGk.css +0 -1
- streamlit/static/static/js/Hooks.BRba_Own.js +0 -1
- streamlit/static/static/js/InputInstructions.xnSDuYeQ.js +0 -1
- streamlit/static/static/js/Particles.CElH0XX2.js +0 -1
- streamlit/static/static/js/data-grid-overlay-editor.DcuHuCyW.js +0 -1
- streamlit/static/static/js/index.6xX1278W.js +0 -975
- streamlit/static/static/js/index.B-hiXRzw.js +0 -1
- streamlit/static/static/js/index.B4cAbHP6.js +0 -1
- streamlit/static/static/js/index.B4dUQfni.js +0 -1
- streamlit/static/static/js/index.BPQo7BKk.js +0 -1
- streamlit/static/static/js/index.Baqa90pe.js +0 -2
- streamlit/static/static/js/index.Bj9JgOEC.js +0 -1
- streamlit/static/static/js/index.BjCwMzj4.js +0 -3
- streamlit/static/static/js/index.Bm3VbPB5.js +0 -1
- streamlit/static/static/js/index.Bxz2yX3P.js +0 -1
- streamlit/static/static/js/index.BycLveZ4.js +0 -1
- streamlit/static/static/js/index.C9BdUqTi.js +0 -1
- streamlit/static/static/js/index.CFMf5_ez.js +0 -197
- streamlit/static/static/js/index.CGYqqs6j.js +0 -1
- streamlit/static/static/js/index.CMItVsFA.js +0 -1
- streamlit/static/static/js/index.CTBk8Vk2.js +0 -1
- streamlit/static/static/js/index.CiAQIz1H.js +0 -7
- streamlit/static/static/js/index.Cj7DSzVR.js +0 -73
- streamlit/static/static/js/index.Ck8rQ9OL.js +0 -1
- streamlit/static/static/js/index.ClELlchS.js +0 -1617
- streamlit/static/static/js/index.Cnpi3o3E.js +0 -1
- streamlit/static/static/js/index.D2QEXQq_.js +0 -1
- streamlit/static/static/js/index.DH71Ezyj.js +0 -1
- streamlit/static/static/js/index.DHh-U0dK.js +0 -3
- streamlit/static/static/js/index.DK7hD7_w.js +0 -1
- streamlit/static/static/js/index.DKv_lNO7.js +0 -2
- streamlit/static/static/js/index.DNLrMXgm.js +0 -12
- streamlit/static/static/js/index.DW0Grddz.js +0 -1
- streamlit/static/static/js/index.Dbe-Q3C-.js +0 -2
- streamlit/static/static/js/index.DcPNYEUo.js +0 -1
- streamlit/static/static/js/index.DuxqVQpd.js +0 -1
- streamlit/static/static/js/index.GRUzrudl.js +0 -1
- streamlit/static/static/js/number-overlay-editor.DdgVR5m3.js +0 -9
- streamlit/static/static/js/uniqueId.RI1LJdtz.js +0 -1
- streamlit/static/static/js/useUpdateUiValue.DeXelfRH.js +0 -1
- streamlit/static/static/js/withFullScreenWrapper.C3561XxJ.js +0 -1
- streamlit/static/static/media/MaterialSymbols-Rounded.DeCZgS-4.woff2 +0 -0
- streamlit-1.50.0.dist-info/RECORD +0 -557
- {streamlit-1.50.0.data → streamlit-1.52.0.data}/scripts/streamlit.cmd +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/WHEEL +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/entry_points.txt +0 -0
- {streamlit-1.50.0.dist-info → streamlit-1.52.0.dist-info}/top_level.txt +0 -0
streamlit/dataframe_util.py
CHANGED
|
@@ -30,14 +30,14 @@ from typing import (
|
|
|
30
30
|
Any,
|
|
31
31
|
Final,
|
|
32
32
|
Protocol,
|
|
33
|
+
TypeAlias,
|
|
34
|
+
TypeGuard,
|
|
33
35
|
TypeVar,
|
|
34
36
|
Union,
|
|
35
37
|
cast,
|
|
36
38
|
runtime_checkable,
|
|
37
39
|
)
|
|
38
40
|
|
|
39
|
-
from typing_extensions import TypeAlias, TypeGuard
|
|
40
|
-
|
|
41
41
|
from streamlit import config, errors, logger, string_util
|
|
42
42
|
from streamlit.type_util import (
|
|
43
43
|
CustomDict,
|
|
@@ -153,7 +153,7 @@ class DataFrameGenericAlias(Protocol[V_co]):
|
|
|
153
153
|
class PandasCompatible(Protocol):
|
|
154
154
|
"""Protocol for Pandas compatible objects that have a `to_pandas` method."""
|
|
155
155
|
|
|
156
|
-
def to_pandas(self) -> DataFrame | Series: ...
|
|
156
|
+
def to_pandas(self) -> DataFrame | Series[Any]: ...
|
|
157
157
|
|
|
158
158
|
|
|
159
159
|
class DataframeInterchangeCompatible(Protocol):
|
|
@@ -165,21 +165,21 @@ class DataframeInterchangeCompatible(Protocol):
|
|
|
165
165
|
def __dataframe__(self, allow_copy: bool) -> Any: ...
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
OptionSequence: TypeAlias =
|
|
169
|
-
Iterable[V_co]
|
|
170
|
-
DataFrameGenericAlias[V_co]
|
|
171
|
-
PandasCompatible
|
|
172
|
-
DataframeInterchangeCompatible
|
|
173
|
-
|
|
168
|
+
OptionSequence: TypeAlias = (
|
|
169
|
+
Iterable[V_co]
|
|
170
|
+
| DataFrameGenericAlias[V_co]
|
|
171
|
+
| PandasCompatible
|
|
172
|
+
| DataframeInterchangeCompatible
|
|
173
|
+
)
|
|
174
174
|
|
|
175
175
|
# Various data types supported by our dataframe processing
|
|
176
176
|
# used for commands like `st.dataframe`, `st.table`, `st.map`,
|
|
177
177
|
# st.line_chart`...
|
|
178
178
|
Data: TypeAlias = Union[
|
|
179
179
|
"DataFrame",
|
|
180
|
-
"Series",
|
|
180
|
+
"Series[Any]",
|
|
181
181
|
"Styler",
|
|
182
|
-
"Index",
|
|
182
|
+
"Index[Any]",
|
|
183
183
|
"pa.Table",
|
|
184
184
|
"pa.Array",
|
|
185
185
|
"np.ndarray[Any, np.dtype[Any]]",
|
|
@@ -502,7 +502,7 @@ def _fix_column_naming(data_df: DataFrame) -> DataFrame:
|
|
|
502
502
|
which is not very descriptive.
|
|
503
503
|
"""
|
|
504
504
|
|
|
505
|
-
if len(data_df.columns) == 1 and data_df.columns[0] == 0:
|
|
505
|
+
if len(data_df.columns) == 1 and cast("Any", data_df.columns[0]) == 0:
|
|
506
506
|
# Pandas automatically names the first column with 0 if it is not named.
|
|
507
507
|
# We rename it to "value" to make it more descriptive if there is only
|
|
508
508
|
# one column in the dataframe.
|
|
@@ -528,6 +528,13 @@ def _dict_to_pandas_df(data: dict[Any, Any]) -> DataFrame:
|
|
|
528
528
|
return _fix_column_naming(pd.DataFrame.from_dict(data, orient="index"))
|
|
529
529
|
|
|
530
530
|
|
|
531
|
+
def has_range_index(df: DataFrame) -> bool:
|
|
532
|
+
"""True if the dataframe has a range index."""
|
|
533
|
+
from pandas import RangeIndex
|
|
534
|
+
|
|
535
|
+
return isinstance(df.index, RangeIndex)
|
|
536
|
+
|
|
537
|
+
|
|
531
538
|
def convert_anything_to_pandas_df(
|
|
532
539
|
data: Any,
|
|
533
540
|
max_unevaluated_rows: int = _MAX_UNEVALUATED_DF_ROWS,
|
|
@@ -559,13 +566,13 @@ def convert_anything_to_pandas_df(
|
|
|
559
566
|
import pandas as pd
|
|
560
567
|
|
|
561
568
|
if isinstance(data, pd.DataFrame):
|
|
562
|
-
return data.copy() if ensure_copy else
|
|
569
|
+
return data.copy() if ensure_copy else data
|
|
563
570
|
|
|
564
571
|
if isinstance(data, (pd.Series, pd.Index, pd.api.extensions.ExtensionArray)):
|
|
565
572
|
return pd.DataFrame(data)
|
|
566
573
|
|
|
567
574
|
if is_pandas_styler(data):
|
|
568
|
-
return cast("pd.DataFrame", data.data.copy() if ensure_copy else data.data)
|
|
575
|
+
return cast("pd.DataFrame", data.data.copy() if ensure_copy else data.data) # type: ignore
|
|
569
576
|
|
|
570
577
|
if isinstance(data, np.ndarray):
|
|
571
578
|
return (
|
|
@@ -576,11 +583,11 @@ def convert_anything_to_pandas_df(
|
|
|
576
583
|
|
|
577
584
|
if is_polars_dataframe(data):
|
|
578
585
|
data = data.clone() if ensure_copy else data
|
|
579
|
-
return data.to_pandas()
|
|
586
|
+
return cast("pd.DataFrame", data.to_pandas())
|
|
580
587
|
|
|
581
588
|
if is_polars_series(data):
|
|
582
589
|
data = data.clone() if ensure_copy else data
|
|
583
|
-
return data.to_pandas().to_frame()
|
|
590
|
+
return cast("pd.DataFrame", data.to_pandas().to_frame())
|
|
584
591
|
|
|
585
592
|
if is_polars_lazyframe(data):
|
|
586
593
|
data = data.limit(max_unevaluated_rows).collect().to_pandas()
|
|
@@ -594,12 +601,12 @@ def convert_anything_to_pandas_df(
|
|
|
594
601
|
if is_xarray_dataset(data):
|
|
595
602
|
if ensure_copy:
|
|
596
603
|
data = data.copy(deep=True)
|
|
597
|
-
return data.to_dataframe()
|
|
604
|
+
return cast("pd.DataFrame", data.to_dataframe())
|
|
598
605
|
|
|
599
606
|
if is_xarray_data_array(data):
|
|
600
607
|
if ensure_copy:
|
|
601
608
|
data = data.copy(deep=True)
|
|
602
|
-
return data.to_series().to_frame()
|
|
609
|
+
return cast("pd.DataFrame", data.to_series().to_frame())
|
|
603
610
|
|
|
604
611
|
if is_dask_object(data):
|
|
605
612
|
data = data.head(max_unevaluated_rows, compute=True)
|
|
@@ -677,7 +684,7 @@ def convert_anything_to_pandas_df(
|
|
|
677
684
|
f"⚠️ Showing only {string_util.simplify_number(max_unevaluated_rows)} "
|
|
678
685
|
"rows. Call `df()` on the relation to show more."
|
|
679
686
|
)
|
|
680
|
-
return data
|
|
687
|
+
return cast("pd.DataFrame", data)
|
|
681
688
|
|
|
682
689
|
if is_dbapi_cursor(data):
|
|
683
690
|
# Based on the specification, the first item in the description is the
|
|
@@ -691,7 +698,7 @@ def convert_anything_to_pandas_df(
|
|
|
691
698
|
f"⚠️ Showing only {string_util.simplify_number(max_unevaluated_rows)} "
|
|
692
699
|
"rows. Call `fetchall()` on the Cursor to show more."
|
|
693
700
|
)
|
|
694
|
-
return data
|
|
701
|
+
return cast("DataFrame", data) # ty: ignore[redundant-cast]
|
|
695
702
|
|
|
696
703
|
if is_snowpark_row_list(data):
|
|
697
704
|
return pd.DataFrame([row.as_dict() for row in data])
|
|
@@ -720,7 +727,7 @@ def convert_anything_to_pandas_df(
|
|
|
720
727
|
f"⚠️ Showing only {string_util.simplify_number(max_unevaluated_rows)} "
|
|
721
728
|
"rows. Convert the data to a list to show more."
|
|
722
729
|
)
|
|
723
|
-
return data
|
|
730
|
+
return cast("DataFrame", data) # ty: ignore[redundant-cast]
|
|
724
731
|
|
|
725
732
|
if isinstance(data, EnumMeta):
|
|
726
733
|
# Support for enum classes
|
|
@@ -852,7 +859,7 @@ def convert_arrow_bytes_to_pandas_df(source: bytes) -> DataFrame:
|
|
|
852
859
|
import pyarrow as pa
|
|
853
860
|
|
|
854
861
|
reader = pa.RecordBatchStreamReader(source)
|
|
855
|
-
return reader.read_pandas()
|
|
862
|
+
return cast("DataFrame", reader.read_pandas())
|
|
856
863
|
|
|
857
864
|
|
|
858
865
|
def _show_data_information(msg: str) -> None:
|
|
@@ -1033,7 +1040,7 @@ def _maybe_truncate_table(
|
|
|
1033
1040
|
return table
|
|
1034
1041
|
|
|
1035
1042
|
|
|
1036
|
-
def is_colum_type_arrow_incompatible(column: Series[Any] | Index) -> bool:
|
|
1043
|
+
def is_colum_type_arrow_incompatible(column: Series[Any] | Index[Any]) -> bool:
|
|
1037
1044
|
"""Return True if the column type is known to cause issues during
|
|
1038
1045
|
Arrow conversion.
|
|
1039
1046
|
"""
|
|
@@ -1274,7 +1281,7 @@ def _unify_missing_values(df: DataFrame) -> DataFrame:
|
|
|
1274
1281
|
# then infer objects without creating a separate copy:
|
|
1275
1282
|
# For performance reasons, we could use copy=False here.
|
|
1276
1283
|
# However, this is only available in pandas >=2.
|
|
1277
|
-
return df.replace([pd.NA, pd.NaT, np.nan], None).infer_objects()
|
|
1284
|
+
return df.replace([pd.NA, pd.NaT, np.nan], None).infer_objects() # type: ignore
|
|
1278
1285
|
|
|
1279
1286
|
|
|
1280
1287
|
def _pandas_df_to_series(df: DataFrame) -> Series[Any]:
|
|
@@ -1290,7 +1297,7 @@ def _pandas_df_to_series(df: DataFrame) -> Series[Any]:
|
|
|
1290
1297
|
raise ValueError(
|
|
1291
1298
|
f"DataFrame is expected to have a single column but has {len(df.columns)}."
|
|
1292
1299
|
)
|
|
1293
|
-
return df
|
|
1300
|
+
return df.iloc[:, 0]
|
|
1294
1301
|
|
|
1295
1302
|
|
|
1296
1303
|
def convert_pandas_df_to_data_format(
|
|
@@ -1397,7 +1404,7 @@ def convert_pandas_df_to_data_format(
|
|
|
1397
1404
|
return_list = []
|
|
1398
1405
|
if len(df.columns) == 1:
|
|
1399
1406
|
# Get the first column and convert to list
|
|
1400
|
-
return_list = df
|
|
1407
|
+
return_list = df.iloc[:, 0].tolist()
|
|
1401
1408
|
elif len(df.columns) >= 1:
|
|
1402
1409
|
raise ValueError(
|
|
1403
1410
|
"DataFrame is expected to have a single column but "
|
streamlit/delta_generator.py
CHANGED
|
@@ -17,21 +17,19 @@
|
|
|
17
17
|
from __future__ import annotations
|
|
18
18
|
|
|
19
19
|
import sys
|
|
20
|
-
from collections.abc import Iterable
|
|
20
|
+
from collections.abc import Callable, Iterable
|
|
21
21
|
from copy import deepcopy
|
|
22
22
|
from typing import (
|
|
23
23
|
TYPE_CHECKING,
|
|
24
24
|
Any,
|
|
25
|
-
Callable,
|
|
26
25
|
Final,
|
|
27
26
|
Literal,
|
|
28
27
|
NoReturn,
|
|
28
|
+
TypeAlias,
|
|
29
29
|
TypeVar,
|
|
30
30
|
cast,
|
|
31
31
|
)
|
|
32
32
|
|
|
33
|
-
from typing_extensions import TypeAlias
|
|
34
|
-
|
|
35
33
|
from streamlit import (
|
|
36
34
|
cli_util,
|
|
37
35
|
config,
|
|
@@ -41,6 +39,7 @@ from streamlit import (
|
|
|
41
39
|
runtime,
|
|
42
40
|
util,
|
|
43
41
|
)
|
|
42
|
+
from streamlit.components.v2.bidi_component import BidiComponentMixin
|
|
44
43
|
from streamlit.delta_generator_singletons import (
|
|
45
44
|
context_dg_stack,
|
|
46
45
|
get_last_dg_added_to_context_stack,
|
|
@@ -65,7 +64,9 @@ from streamlit.elements.layouts import LayoutsMixin
|
|
|
65
64
|
from streamlit.elements.lib.form_utils import FormData, current_form_id
|
|
66
65
|
from streamlit.elements.lib.layout_utils import (
|
|
67
66
|
get_height_config,
|
|
67
|
+
get_text_alignment_config,
|
|
68
68
|
get_width_config,
|
|
69
|
+
validate_text_alignment,
|
|
69
70
|
)
|
|
70
71
|
from streamlit.elements.map import MapMixin
|
|
71
72
|
from streamlit.elements.markdown import MarkdownMixin
|
|
@@ -76,6 +77,7 @@ from streamlit.elements.plotly_chart import PlotlyMixin
|
|
|
76
77
|
from streamlit.elements.progress import ProgressMixin
|
|
77
78
|
from streamlit.elements.pyplot import PyplotMixin
|
|
78
79
|
from streamlit.elements.snow import SnowMixin
|
|
80
|
+
from streamlit.elements.space import SpaceMixin
|
|
79
81
|
from streamlit.elements.text import TextMixin
|
|
80
82
|
from streamlit.elements.toast import ToastMixin
|
|
81
83
|
from streamlit.elements.vega_charts import VegaChartsMixin
|
|
@@ -207,6 +209,7 @@ class DeltaGenerator(
|
|
|
207
209
|
SelectSliderMixin,
|
|
208
210
|
SliderMixin,
|
|
209
211
|
SnowMixin,
|
|
212
|
+
SpaceMixin,
|
|
210
213
|
JsonMixin,
|
|
211
214
|
TextMixin,
|
|
212
215
|
TextWidgetsMixin,
|
|
@@ -216,6 +219,7 @@ class DeltaGenerator(
|
|
|
216
219
|
ArrowMixin,
|
|
217
220
|
VegaChartsMixin,
|
|
218
221
|
DataEditorMixin,
|
|
222
|
+
BidiComponentMixin,
|
|
219
223
|
):
|
|
220
224
|
"""Creator of Delta protobuf messages.
|
|
221
225
|
|
|
@@ -493,6 +497,11 @@ class DeltaGenerator(
|
|
|
493
497
|
msg.delta.new_element.width_config.CopyFrom(
|
|
494
498
|
get_width_config(layout_config.width)
|
|
495
499
|
)
|
|
500
|
+
if layout_config.text_alignment is not None:
|
|
501
|
+
validate_text_alignment(layout_config.text_alignment)
|
|
502
|
+
msg.delta.new_element.text_alignment_config.CopyFrom(
|
|
503
|
+
get_text_alignment_config(layout_config.text_alignment)
|
|
504
|
+
)
|
|
496
505
|
|
|
497
506
|
# Only enqueue message and fill in metadata if there's a container.
|
|
498
507
|
msg_was_enqueued = False
|
|
@@ -20,11 +20,13 @@ cycle between streamlit.delta_generator and some elements.
|
|
|
20
20
|
from __future__ import annotations
|
|
21
21
|
|
|
22
22
|
from contextvars import ContextVar, Token
|
|
23
|
-
from typing import TYPE_CHECKING,
|
|
23
|
+
from typing import TYPE_CHECKING, Generic, TypeVar
|
|
24
24
|
|
|
25
25
|
from streamlit.proto.RootContainer_pb2 import RootContainer as _RootContainer
|
|
26
26
|
|
|
27
27
|
if TYPE_CHECKING:
|
|
28
|
+
from collections.abc import Callable
|
|
29
|
+
|
|
28
30
|
from streamlit.delta_generator import DeltaGenerator
|
|
29
31
|
from streamlit.elements.lib.dialog import Dialog
|
|
30
32
|
from streamlit.elements.lib.mutable_status_container import StatusContainer
|
|
@@ -143,28 +145,22 @@ class ContextVarWithLazyDefault(Generic[_T]):
|
|
|
143
145
|
self._default = default
|
|
144
146
|
self._context_var: ContextVar[_T] | None = None
|
|
145
147
|
|
|
146
|
-
def
|
|
147
|
-
self._context_var
|
|
148
|
+
def _ensure_context_var(self) -> ContextVar[_T]:
|
|
149
|
+
if self._context_var is None:
|
|
150
|
+
self._context_var = ContextVar(self._name, default=self._default()) # noqa: B039
|
|
151
|
+
return self._context_var
|
|
148
152
|
|
|
149
153
|
def get(self) -> _T:
|
|
150
|
-
|
|
151
|
-
self._init_context_var()
|
|
152
|
-
return self._context_var.get() # type: ignore[union-attr]
|
|
154
|
+
return self._ensure_context_var().get()
|
|
153
155
|
|
|
154
156
|
def set(self, value: _T) -> Token[_T]:
|
|
155
|
-
|
|
156
|
-
self._init_context_var()
|
|
157
|
-
return self._context_var.set(value) # type: ignore[union-attr]
|
|
157
|
+
return self._ensure_context_var().set(value)
|
|
158
158
|
|
|
159
159
|
def reset(self, token: Token[_T]) -> None:
|
|
160
|
-
|
|
161
|
-
self._init_context_var()
|
|
162
|
-
self._context_var.reset(token) # type: ignore[union-attr]
|
|
160
|
+
self._ensure_context_var().reset(token)
|
|
163
161
|
|
|
164
162
|
def __hash__(self) -> int:
|
|
165
|
-
|
|
166
|
-
self._init_context_var()
|
|
167
|
-
return self._context_var.__hash__()
|
|
163
|
+
return self._ensure_context_var().__hash__()
|
|
168
164
|
|
|
169
165
|
|
|
170
166
|
# we don't use the default factory here because `main_dg` is not initialized when this
|
streamlit/deprecation_util.py
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
from __future__ import annotations
|
|
16
16
|
|
|
17
17
|
import functools
|
|
18
|
-
from
|
|
18
|
+
from collections.abc import Callable
|
|
19
|
+
from typing import Any, Final, TypeVar, cast
|
|
19
20
|
|
|
20
21
|
import streamlit
|
|
21
22
|
from streamlit import config
|
|
@@ -28,8 +29,17 @@ TObj = TypeVar("TObj", bound=object)
|
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
def _error_details_in_browser_enabled() -> bool:
|
|
31
|
-
"""True if we should print deprecation warnings to the browser.
|
|
32
|
-
|
|
32
|
+
"""True if we should print deprecation warnings to the browser.
|
|
33
|
+
|
|
34
|
+
Deprecation warnings are only shown when showErrorDetails is set to "full"
|
|
35
|
+
or the legacy True value. All other values ("stacktrace", "type", "none",
|
|
36
|
+
False) hide deprecation warnings in the browser.
|
|
37
|
+
"""
|
|
38
|
+
show_error_details = config.get_option("client.showErrorDetails")
|
|
39
|
+
return (
|
|
40
|
+
show_error_details == config.ShowErrorDetailsConfigOptions.FULL
|
|
41
|
+
or config.ShowErrorDetailsConfigOptions.is_true_variation(show_error_details)
|
|
42
|
+
)
|
|
33
43
|
|
|
34
44
|
|
|
35
45
|
def show_deprecation_warning(message: str, show_in_browser: bool = True) -> None:
|
|
@@ -41,9 +51,10 @@ def show_deprecation_warning(message: str, show_in_browser: bool = True) -> None
|
|
|
41
51
|
The deprecation warning message.
|
|
42
52
|
show_in_browser : bool, default=True
|
|
43
53
|
Whether to show the deprecation warning in the browser. When this is True,
|
|
44
|
-
we will show the deprecation warning in the browser
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
we will show the deprecation warning in the browser only if the user has
|
|
55
|
+
set `client.showErrorDetails` to "full" or the legacy True value. All
|
|
56
|
+
other values ("stacktrace", "type", "none", False) will hide deprecation
|
|
57
|
+
warnings in the browser (but still log them to the console).
|
|
47
58
|
"""
|
|
48
59
|
if _error_details_in_browser_enabled() and show_in_browser:
|
|
49
60
|
streamlit.warning(message)
|
streamlit/elements/alert.py
CHANGED
|
@@ -50,6 +50,7 @@ class AlertMixin:
|
|
|
50
50
|
|
|
51
51
|
.. |st.markdown| replace:: ``st.markdown``
|
|
52
52
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
|
53
|
+
|
|
53
54
|
icon : str, None
|
|
54
55
|
An optional emoji or icon to display next to the alert. If ``icon``
|
|
55
56
|
is ``None`` (default), no icon is displayed. If ``icon`` is a
|
|
@@ -66,6 +67,9 @@ class AlertMixin:
|
|
|
66
67
|
Thumb Up icon. Find additional icons in the `Material Symbols \
|
|
67
68
|
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
|
68
69
|
font library.
|
|
70
|
+
|
|
71
|
+
- ``"spinner"``: Displays a spinner as an icon.
|
|
72
|
+
|
|
69
73
|
width : "stretch" or int
|
|
70
74
|
The width of the alert element. This can be one of the following:
|
|
71
75
|
|
|
@@ -123,6 +127,7 @@ class AlertMixin:
|
|
|
123
127
|
|
|
124
128
|
.. |st.markdown| replace:: ``st.markdown``
|
|
125
129
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
|
130
|
+
|
|
126
131
|
icon : str, None
|
|
127
132
|
An optional emoji or icon to display next to the alert. If ``icon``
|
|
128
133
|
is ``None`` (default), no icon is displayed. If ``icon`` is a
|
|
@@ -139,6 +144,9 @@ class AlertMixin:
|
|
|
139
144
|
Thumb Up icon. Find additional icons in the `Material Symbols \
|
|
140
145
|
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
|
141
146
|
font library.
|
|
147
|
+
|
|
148
|
+
- ``"spinner"``: Displays a spinner as an icon.
|
|
149
|
+
|
|
142
150
|
width : "stretch" or int
|
|
143
151
|
The width of the warning element. This can be one of the following:
|
|
144
152
|
|
|
@@ -195,6 +203,7 @@ class AlertMixin:
|
|
|
195
203
|
|
|
196
204
|
.. |st.markdown| replace:: ``st.markdown``
|
|
197
205
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
|
206
|
+
|
|
198
207
|
icon : str, None
|
|
199
208
|
An optional emoji or icon to display next to the alert. If ``icon``
|
|
200
209
|
is ``None`` (default), no icon is displayed. If ``icon`` is a
|
|
@@ -211,6 +220,9 @@ class AlertMixin:
|
|
|
211
220
|
Thumb Up icon. Find additional icons in the `Material Symbols \
|
|
212
221
|
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
|
213
222
|
font library.
|
|
223
|
+
|
|
224
|
+
- ``"spinner"``: Displays a spinner as an icon.
|
|
225
|
+
|
|
214
226
|
width : "stretch" or int
|
|
215
227
|
The width of the info element. This can be one of the following:
|
|
216
228
|
|
|
@@ -268,6 +280,7 @@ class AlertMixin:
|
|
|
268
280
|
|
|
269
281
|
.. |st.markdown| replace:: ``st.markdown``
|
|
270
282
|
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
|
283
|
+
|
|
271
284
|
icon : str, None
|
|
272
285
|
An optional emoji or icon to display next to the alert. If ``icon``
|
|
273
286
|
is ``None`` (default), no icon is displayed. If ``icon`` is a
|
|
@@ -284,6 +297,9 @@ class AlertMixin:
|
|
|
284
297
|
Thumb Up icon. Find additional icons in the `Material Symbols \
|
|
285
298
|
<https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
|
|
286
299
|
font library.
|
|
300
|
+
|
|
301
|
+
- ``"spinner"``: Displays a spinner as an icon.
|
|
302
|
+
|
|
287
303
|
width : "stretch" or int
|
|
288
304
|
The width of the success element. This can be one of the following:
|
|
289
305
|
|
streamlit/elements/arrow.py
CHANGED
|
@@ -16,9 +16,16 @@ from __future__ import annotations
|
|
|
16
16
|
|
|
17
17
|
import json
|
|
18
18
|
from dataclasses import dataclass
|
|
19
|
-
from typing import
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
from typing import (
|
|
20
|
+
TYPE_CHECKING,
|
|
21
|
+
Any,
|
|
22
|
+
Final,
|
|
23
|
+
Literal,
|
|
24
|
+
TypeAlias,
|
|
25
|
+
TypedDict,
|
|
26
|
+
cast,
|
|
27
|
+
overload,
|
|
28
|
+
)
|
|
22
29
|
|
|
23
30
|
from streamlit import dataframe_util
|
|
24
31
|
from streamlit.deprecation_util import (
|
|
@@ -35,6 +42,7 @@ from streamlit.elements.lib.column_config_utils import (
|
|
|
35
42
|
)
|
|
36
43
|
from streamlit.elements.lib.form_utils import current_form_id
|
|
37
44
|
from streamlit.elements.lib.layout_utils import (
|
|
45
|
+
Height,
|
|
38
46
|
LayoutConfig,
|
|
39
47
|
Width,
|
|
40
48
|
validate_height,
|
|
@@ -279,7 +287,7 @@ class ArrowMixin:
|
|
|
279
287
|
self,
|
|
280
288
|
data: Data = None,
|
|
281
289
|
width: Width = "stretch",
|
|
282
|
-
height:
|
|
290
|
+
height: Height | Literal["auto"] = "auto",
|
|
283
291
|
*,
|
|
284
292
|
use_container_width: bool | None = None,
|
|
285
293
|
hide_index: bool | None = None,
|
|
@@ -289,6 +297,7 @@ class ArrowMixin:
|
|
|
289
297
|
on_select: Literal["ignore"] = "ignore",
|
|
290
298
|
selection_mode: SelectionMode | Iterable[SelectionMode] = "multi-row",
|
|
291
299
|
row_height: int | None = None,
|
|
300
|
+
placeholder: str | None = None,
|
|
292
301
|
) -> DeltaGenerator: ...
|
|
293
302
|
|
|
294
303
|
@overload
|
|
@@ -296,7 +305,7 @@ class ArrowMixin:
|
|
|
296
305
|
self,
|
|
297
306
|
data: Data = None,
|
|
298
307
|
width: Width = "stretch",
|
|
299
|
-
height:
|
|
308
|
+
height: Height | Literal["auto"] = "auto",
|
|
300
309
|
*,
|
|
301
310
|
use_container_width: bool | None = None,
|
|
302
311
|
hide_index: bool | None = None,
|
|
@@ -306,6 +315,7 @@ class ArrowMixin:
|
|
|
306
315
|
on_select: Literal["rerun"] | WidgetCallback,
|
|
307
316
|
selection_mode: SelectionMode | Iterable[SelectionMode] = "multi-row",
|
|
308
317
|
row_height: int | None = None,
|
|
318
|
+
placeholder: str | None = None,
|
|
309
319
|
) -> DataframeState: ...
|
|
310
320
|
|
|
311
321
|
@gather_metrics("dataframe")
|
|
@@ -313,7 +323,7 @@ class ArrowMixin:
|
|
|
313
323
|
self,
|
|
314
324
|
data: Data = None,
|
|
315
325
|
width: Width = "stretch",
|
|
316
|
-
height:
|
|
326
|
+
height: Height | Literal["auto"] = "auto",
|
|
317
327
|
*,
|
|
318
328
|
use_container_width: bool | None = None,
|
|
319
329
|
hide_index: bool | None = None,
|
|
@@ -323,6 +333,7 @@ class ArrowMixin:
|
|
|
323
333
|
on_select: Literal["ignore", "rerun"] | WidgetCallback = "ignore",
|
|
324
334
|
selection_mode: SelectionMode | Iterable[SelectionMode] = "multi-row",
|
|
325
335
|
row_height: int | None = None,
|
|
336
|
+
placeholder: str | None = None,
|
|
326
337
|
) -> DeltaGenerator | DataframeState:
|
|
327
338
|
"""Display a dataframe as an interactive table.
|
|
328
339
|
|
|
@@ -381,11 +392,21 @@ class ArrowMixin:
|
|
|
381
392
|
the parent container, the width of the element matches the width
|
|
382
393
|
of the parent container.
|
|
383
394
|
|
|
384
|
-
height :
|
|
395
|
+
height : "auto", "content", "stretch", or int
|
|
385
396
|
The height of the dataframe element. This can be one of the following:
|
|
386
397
|
|
|
387
398
|
- ``"auto"`` (default): Streamlit sets the height to show at most
|
|
388
399
|
ten rows.
|
|
400
|
+
- ``"content"``: The height of the element matches the height of
|
|
401
|
+
its content. The height is capped at 10,000 pixels to prevent
|
|
402
|
+
performance issues with very large dataframes.
|
|
403
|
+
- ``"stretch"``: The height of the element expands to fill the
|
|
404
|
+
available vertical space in its parent container. When multiple
|
|
405
|
+
elements with stretch height are in the same container, they
|
|
406
|
+
share the available vertical space evenly. The dataframe will
|
|
407
|
+
maintain a minimum height to display up to three rows, but
|
|
408
|
+
otherwise won't exceed the available height in its parent
|
|
409
|
+
container.
|
|
389
410
|
- An integer specifying the height in pixels: The element has a
|
|
390
411
|
fixed height.
|
|
391
412
|
|
|
@@ -407,7 +428,7 @@ class ArrowMixin:
|
|
|
407
428
|
hide_index : bool or None
|
|
408
429
|
Whether to hide the index column(s). If ``hide_index`` is ``None``
|
|
409
430
|
(default), the visibility of index columns is automatically
|
|
410
|
-
determined based on the data.
|
|
431
|
+
determined based on the data and other configurations.
|
|
411
432
|
|
|
412
433
|
column_order : Iterable[str] or None
|
|
413
434
|
The ordered list of columns to display. If this is ``None``
|
|
@@ -495,6 +516,12 @@ class ArrowMixin:
|
|
|
495
516
|
is ``None`` (default), Streamlit will use a default row height,
|
|
496
517
|
which fits one line of text.
|
|
497
518
|
|
|
519
|
+
placeholder : str or None
|
|
520
|
+
The text that should be shown for missing values. If this is
|
|
521
|
+
``None`` (default), missing values are displayed as "None". To
|
|
522
|
+
leave a cell empty, use an empty string (``""``). Other common
|
|
523
|
+
values are ``"null"``, ``"NaN"`` and ``"-"``.
|
|
524
|
+
|
|
498
525
|
Returns
|
|
499
526
|
-------
|
|
500
527
|
element or dict
|
|
@@ -661,8 +688,7 @@ class ArrowMixin:
|
|
|
661
688
|
validate_width(width, allow_content=True)
|
|
662
689
|
validate_height(
|
|
663
690
|
height,
|
|
664
|
-
allow_content=
|
|
665
|
-
allow_stretch=False,
|
|
691
|
+
allow_content=True,
|
|
666
692
|
additional_allowed=["auto"],
|
|
667
693
|
)
|
|
668
694
|
|
|
@@ -677,8 +703,12 @@ class ArrowMixin:
|
|
|
677
703
|
if column_order:
|
|
678
704
|
proto.column_order[:] = column_order
|
|
679
705
|
|
|
706
|
+
if placeholder is not None:
|
|
707
|
+
proto.placeholder = placeholder
|
|
708
|
+
|
|
680
709
|
proto.editing_mode = ArrowProto.EditingMode.READ_ONLY
|
|
681
710
|
|
|
711
|
+
has_range_index: bool = False
|
|
682
712
|
if isinstance(data, pa.Table):
|
|
683
713
|
# For pyarrow tables, we can just serialize the table directly
|
|
684
714
|
proto.data = dataframe_util.convert_arrow_table_to_arrow_bytes(data)
|
|
@@ -701,6 +731,7 @@ class ArrowMixin:
|
|
|
701
731
|
data_df = dataframe_util.convert_anything_to_pandas_df(
|
|
702
732
|
data, ensure_copy=False
|
|
703
733
|
)
|
|
734
|
+
has_range_index = dataframe_util.has_range_index(data_df)
|
|
704
735
|
apply_data_specific_configs(column_config_mapping, data_format)
|
|
705
736
|
# Serialize the data to bytes:
|
|
706
737
|
proto.data = dataframe_util.convert_pandas_df_to_arrow_bytes(data_df)
|
|
@@ -709,6 +740,18 @@ class ArrowMixin:
|
|
|
709
740
|
update_column_config(
|
|
710
741
|
column_config_mapping, INDEX_IDENTIFIER, {"hidden": hide_index}
|
|
711
742
|
)
|
|
743
|
+
|
|
744
|
+
elif (
|
|
745
|
+
# Hide index column if row selections are activated and the dataframe has a range index.
|
|
746
|
+
# The range index usually does not add a lot of value.
|
|
747
|
+
is_selection_activated
|
|
748
|
+
and selection_mode in ["multi-row", "single-row"]
|
|
749
|
+
and has_range_index
|
|
750
|
+
):
|
|
751
|
+
update_column_config(
|
|
752
|
+
column_config_mapping, INDEX_IDENTIFIER, {"hidden": True}
|
|
753
|
+
)
|
|
754
|
+
|
|
712
755
|
marshall_column_config(proto, column_config_mapping)
|
|
713
756
|
|
|
714
757
|
# Create layout configuration
|
|
@@ -739,6 +782,7 @@ class ArrowMixin:
|
|
|
739
782
|
selection_mode=selection_mode,
|
|
740
783
|
is_selection_activated=is_selection_activated,
|
|
741
784
|
row_height=row_height,
|
|
785
|
+
placeholder=placeholder,
|
|
742
786
|
)
|
|
743
787
|
|
|
744
788
|
serde = DataframeSelectionSerde()
|
|
@@ -867,6 +911,12 @@ class ArrowMixin:
|
|
|
867
911
|
def add_rows(self, data: Data = None, **kwargs: Any) -> DeltaGenerator | None:
|
|
868
912
|
"""Concatenate a dataframe to the bottom of the current one.
|
|
869
913
|
|
|
914
|
+
.. important::
|
|
915
|
+
``add_rows`` is deprecated and might be removed in a future version.
|
|
916
|
+
If you have a specific use-case that requires the ``add_rows``
|
|
917
|
+
functionality, please tell us via this
|
|
918
|
+
[issue on Github](https://github.com/streamlit/streamlit/issues/13063).
|
|
919
|
+
|
|
870
920
|
Parameters
|
|
871
921
|
----------
|
|
872
922
|
data : pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None
|
|
@@ -919,6 +969,14 @@ class ArrowMixin:
|
|
|
919
969
|
>>> my_chart.add_rows(some_fancy_name=df2) # <-- name used as keyword
|
|
920
970
|
|
|
921
971
|
""" # noqa: E501
|
|
972
|
+
show_deprecation_warning(
|
|
973
|
+
"`add_rows` is deprecated and might be removed in a future version."
|
|
974
|
+
" If you have a specific use-case that requires the `add_rows` "
|
|
975
|
+
"functionality, please tell us via this "
|
|
976
|
+
"[issue on Github](https://github.com/streamlit/streamlit/issues/13063).",
|
|
977
|
+
show_in_browser=False,
|
|
978
|
+
)
|
|
979
|
+
|
|
922
980
|
return _arrow_add_rows(self.dg, data, **kwargs)
|
|
923
981
|
|
|
924
982
|
@property
|