streamlit-nightly 1.41.2.dev20250201__py2.py3-none-any.whl → 1.42.1.dev20250204__py2.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.
Files changed (183) hide show
  1. streamlit/auth_util.py +2 -1
  2. streamlit/commands/echo.py +4 -1
  3. streamlit/commands/execution_control.py +3 -1
  4. streamlit/commands/page_config.py +2 -1
  5. streamlit/config.py +56 -25
  6. streamlit/config_option.py +3 -3
  7. streamlit/connections/snowflake_connection.py +22 -10
  8. streamlit/connections/snowpark_connection.py +2 -1
  9. streamlit/connections/util.py +4 -1
  10. streamlit/dataframe_util.py +3 -8
  11. streamlit/delta_generator.py +1 -1
  12. streamlit/elements/alert.py +32 -4
  13. streamlit/elements/arrow.py +28 -15
  14. streamlit/elements/code.py +4 -3
  15. streamlit/elements/deck_gl_json_chart.py +3 -4
  16. streamlit/elements/form.py +22 -4
  17. streamlit/elements/heading.py +21 -6
  18. streamlit/elements/image.py +12 -3
  19. streamlit/elements/layouts.py +9 -4
  20. streamlit/elements/lib/built_in_chart_utils.py +1 -3
  21. streamlit/elements/lib/color_util.py +7 -6
  22. streamlit/elements/lib/column_config_utils.py +4 -3
  23. streamlit/elements/lib/column_types.py +100 -33
  24. streamlit/elements/lib/dicttools.py +4 -1
  25. streamlit/elements/lib/event_utils.py +2 -2
  26. streamlit/elements/lib/file_uploader_utils.py +4 -1
  27. streamlit/elements/lib/image_utils.py +5 -4
  28. streamlit/elements/lib/options_selector_utils.py +4 -1
  29. streamlit/elements/lib/pandas_styler_utils.py +2 -1
  30. streamlit/elements/lib/policies.py +3 -1
  31. streamlit/elements/lib/utils.py +1 -1
  32. streamlit/elements/map.py +3 -1
  33. streamlit/elements/markdown.py +21 -7
  34. streamlit/elements/media.py +2 -2
  35. streamlit/elements/metric.py +8 -4
  36. streamlit/elements/plotly_chart.py +4 -5
  37. streamlit/elements/spinner.py +25 -3
  38. streamlit/elements/text.py +7 -2
  39. streamlit/elements/vega_charts.py +26 -22
  40. streamlit/elements/widgets/audio_input.py +8 -4
  41. streamlit/elements/widgets/button.py +29 -12
  42. streamlit/elements/widgets/button_group.py +29 -13
  43. streamlit/elements/widgets/camera_input.py +8 -4
  44. streamlit/elements/widgets/chat.py +1 -3
  45. streamlit/elements/widgets/checkbox.py +16 -8
  46. streamlit/elements/widgets/color_picker.py +8 -4
  47. streamlit/elements/widgets/data_editor.py +10 -14
  48. streamlit/elements/widgets/file_uploader.py +12 -6
  49. streamlit/elements/widgets/multiselect.py +10 -5
  50. streamlit/elements/widgets/number_input.py +8 -4
  51. streamlit/elements/widgets/radio.py +11 -5
  52. streamlit/elements/widgets/select_slider.py +12 -8
  53. streamlit/elements/widgets/selectbox.py +11 -5
  54. streamlit/elements/widgets/slider.py +19 -17
  55. streamlit/elements/widgets/text_widgets.py +16 -8
  56. streamlit/elements/widgets/time_widgets.py +21 -15
  57. streamlit/elements/write.py +60 -43
  58. streamlit/errors.py +1 -2
  59. streamlit/external/langchain/streamlit_callback_handler.py +3 -3
  60. streamlit/hello/animation_demo.py +1 -1
  61. streamlit/material_icon_names.py +1 -1
  62. streamlit/proto/NewSession_pb2.py +16 -16
  63. streamlit/proto/NewSession_pb2.pyi +30 -3
  64. streamlit/runtime/app_session.py +15 -15
  65. streamlit/runtime/caching/cached_message_replay.py +2 -1
  66. streamlit/runtime/caching/hashing.py +3 -2
  67. streamlit/runtime/context.py +2 -1
  68. streamlit/runtime/forward_msg_cache.py +3 -1
  69. streamlit/runtime/memory_session_storage.py +4 -1
  70. streamlit/runtime/memory_uploaded_file_manager.py +4 -1
  71. streamlit/runtime/runtime.py +6 -4
  72. streamlit/runtime/scriptrunner/script_runner.py +4 -3
  73. streamlit/runtime/scriptrunner_utils/script_run_context.py +2 -3
  74. streamlit/runtime/secrets.py +1 -5
  75. streamlit/runtime/state/common.py +2 -4
  76. streamlit/runtime/state/query_params.py +2 -1
  77. streamlit/runtime/state/query_params_proxy.py +2 -1
  78. streamlit/runtime/state/safe_session_state.py +3 -1
  79. streamlit/runtime/state/session_state.py +2 -5
  80. streamlit/runtime/state/session_state_proxy.py +2 -1
  81. streamlit/runtime/uploaded_file_manager.py +3 -1
  82. streamlit/runtime/websocket_session_manager.py +8 -8
  83. streamlit/static/index.html +2 -2
  84. streamlit/static/static/css/{index.mUTQuMqR.css → index.DpJG_94W.css} +1 -1
  85. streamlit/static/static/js/{FileDownload.esm.Cf3bITtP.js → FileDownload.esm.CuayiK6T.js} +1 -1
  86. streamlit/static/static/js/FileDropzone.CvXoxIUm.js +5 -0
  87. streamlit/static/static/js/{FormClearHelper.BgwPD1tD.js → FormClearHelper.DpwWkrvV.js} +1 -1
  88. streamlit/static/static/js/{Hooks.BMaXaj11.js → Hooks.BQiFiHd5.js} +1 -1
  89. streamlit/static/static/js/{InputInstructions.qlsk9gvt.js → InputInstructions.CypmdrYz.js} +1 -1
  90. streamlit/static/static/js/ProgressBar.DfR4HyQR.js +2 -0
  91. streamlit/static/static/js/{RenderInPortalIfExists.Blpdplqk.js → RenderInPortalIfExists.D6u3szcn.js} +1 -1
  92. streamlit/static/static/js/{Toolbar.DMhyNpv2.js → Toolbar.D6p42Hno.js} +1 -1
  93. streamlit/static/static/js/axios.upsvKRUO.js +6 -0
  94. streamlit/static/static/js/{base-input.DyTEaESI.js → base-input.B5AcLp6p.js} +4 -4
  95. streamlit/static/static/js/{createSuper.B3rIhdpQ.js → createSuper.DNzaJgi-.js} +1 -1
  96. streamlit/static/static/js/{data-grid-overlay-editor.C9Q9Gy4e.js → data-grid-overlay-editor.CKACfVZL.js} +1 -1
  97. streamlit/static/static/js/{downloader.BAMiKd1n.js → downloader.D6HV3a60.js} +1 -1
  98. streamlit/static/static/js/{es6.D82pr6dy.js → es6.UQDWlCyE.js} +2 -2
  99. streamlit/static/static/js/{iframeResizer.contentWindow.CJwxqR7x.js → iframeResizer.contentWindow.DQ-TFrBp.js} +1 -1
  100. streamlit/static/static/js/{index.B7J6suR-.js → index.2EE80u0h.js} +200 -200
  101. streamlit/static/static/js/{index.CoE1gpPQ.js → index.B96fHK2A.js} +1 -1
  102. streamlit/static/static/js/index.BAFGiIHm.js +1 -0
  103. streamlit/static/static/js/index.BPNlEjgz.js +1 -0
  104. streamlit/static/static/js/{index.C4kPuKr4.js → index.BPmrb-47.js} +1 -1
  105. streamlit/static/static/js/{index.BM_J1KkD.js → index.BQEIBi4n.js} +1 -1
  106. streamlit/static/static/js/index.BUGQmWUV.js +3 -0
  107. streamlit/static/static/js/index.BXmBj7MJ.js +1 -0
  108. streamlit/static/static/js/{index.5JFTbX2J.js → index.BY8YeKF1.js} +1 -1
  109. streamlit/static/static/js/{index.CF4stbIZ.js → index.BdVr8Tta.js} +1 -1
  110. streamlit/static/static/js/{index.CjFbbEE0.js → index.BghvoEVe.js} +1 -1
  111. streamlit/static/static/js/{index.8Q56Jjmk.js → index.BiMrOUpK.js} +1 -1
  112. streamlit/static/static/js/{index.yp4f0OMe.js → index.BiybRa0I.js} +2 -2
  113. streamlit/static/static/js/index.Bm7Vkuba.js +73 -0
  114. streamlit/static/static/js/{index.BZvQkTCS.js → index.BuyK2IsW.js} +1 -1
  115. streamlit/static/static/js/index.ByH1pn5_.js +1 -0
  116. streamlit/static/static/js/{index.zlHOKWDA.js → index.C8zZSMvD.js} +1 -1
  117. streamlit/static/static/js/index.CAuJtYES.js +1 -0
  118. streamlit/static/static/js/{index.Y84nTPW2.js → index.CEdHQ1ob.js} +1 -1
  119. streamlit/static/static/js/{index.CqGcWpm5.js → index.CJ-t5S6T.js} +2 -2
  120. streamlit/static/static/js/{index.BdlaxG49.js → index.CKOdbWxq.js} +1 -1
  121. streamlit/static/static/js/index.CSgG8OVN.js +1 -0
  122. streamlit/static/static/js/index.CX9gqq2L.js +1 -0
  123. streamlit/static/static/js/{index.TPHsScPF.js → index.CgVoYKAP.js} +1 -1
  124. streamlit/static/static/js/{index.D9yF6cxC.js → index.ChrjN8GY.js} +1 -1
  125. streamlit/static/static/js/{index.NbimJbgq.js → index.CrMtUJsu.js} +6 -6
  126. streamlit/static/static/js/index.D4SMJhY1.js +1 -0
  127. streamlit/static/static/js/index.D7BxtE4u.js +1 -0
  128. streamlit/static/static/js/{index.P5kx9um8.js → index.DB_dBVfZ.js} +5 -5
  129. streamlit/static/static/js/{index.BLCqXxIG.js → index.DMKXUbO6.js} +1 -1
  130. streamlit/static/static/js/index.DaoBv396.js +1 -0
  131. streamlit/static/static/js/{index.B3Wxz7wG.js → index.DkV6k6Ng.js} +1 -1
  132. streamlit/static/static/js/{index.BcAjRRAZ.js → index.DqZZoWyt.js} +1 -1
  133. streamlit/static/static/js/index.Dr6DSYcq.js +1 -0
  134. streamlit/static/static/js/{index.BdEYCAFh.js → index.Epl2r08f.js} +1 -1
  135. streamlit/static/static/js/{index.CC5oiyoV.js → index.ndVWhafL.js} +2 -2
  136. streamlit/static/static/js/{index.DiZyaYeV.js → index.wW-pPvtW.js} +3 -3
  137. streamlit/static/static/js/{input.DRyjjTTH.js → input.CxqdG-sh.js} +2 -2
  138. streamlit/static/static/js/{memory.C98yjNkk.js → memory.DuSk7Eex.js} +1 -1
  139. streamlit/static/static/js/{mergeWith.CLihEflw.js → mergeWith.DrxB1Sj4.js} +1 -1
  140. streamlit/static/static/js/{number-overlay-editor.DozQhDJj.js → number-overlay-editor.DBc0yndt.js} +1 -1
  141. streamlit/static/static/js/{possibleConstructorReturn.DJ7-JsJc.js → possibleConstructorReturn.ZdYWHeG3.js} +1 -1
  142. streamlit/static/static/js/{sandbox.0Tj4C46D.js → sandbox.D3L4CYjG.js} +1 -1
  143. streamlit/static/static/js/{textarea.CUrV8-V3.js → textarea.CSafh28v.js} +2 -2
  144. streamlit/static/static/js/{timepicker.DEu3fwJe.js → timepicker.C-pwkiaT.js} +4 -4
  145. streamlit/static/static/js/{toConsumableArray.C71OtXzK.js → toConsumableArray.DyCVskz5.js} +1 -1
  146. streamlit/static/static/js/{uniqueId.CndDhnid.js → uniqueId.BODM2vTk.js} +1 -1
  147. streamlit/static/static/js/useBasicWidgetState.DQUiM2dz.js +1 -0
  148. streamlit/static/static/js/{useOnInputChange.CvHbHWmy.js → useOnInputChange.Ccjd55xn.js} +1 -1
  149. streamlit/static/static/js/{withFullScreenWrapper.BLLyDFUF.js → withFullScreenWrapper.CneUoXNE.js} +1 -1
  150. streamlit/static/static/media/MaterialSymbols-Rounded.DcZbplWk.woff2 +0 -0
  151. streamlit/testing/v1/app_test.py +3 -1
  152. streamlit/testing/v1/element_tree.py +3 -4
  153. streamlit/testing/v1/local_script_runner.py +3 -3
  154. streamlit/type_util.py +11 -8
  155. streamlit/user_info.py +2 -3
  156. streamlit/watcher/path_watcher.py +4 -4
  157. streamlit/web/server/authlib_tornado_integration.py +3 -1
  158. streamlit/web/server/browser_websocket_handler.py +3 -1
  159. streamlit/web/server/routes.py +4 -1
  160. streamlit/web/server/server.py +2 -1
  161. {streamlit_nightly-1.41.2.dev20250201.dist-info → streamlit_nightly-1.42.1.dev20250204.dist-info}/METADATA +1 -2
  162. {streamlit_nightly-1.41.2.dev20250201.dist-info → streamlit_nightly-1.42.1.dev20250204.dist-info}/RECORD +166 -165
  163. streamlit/static/static/js/FileDropzone.B8wCqKiM.js +0 -5
  164. streamlit/static/static/js/ProgressBar.Di2oT-20.js +0 -2
  165. streamlit/static/static/js/index.B79cf7gS.js +0 -1
  166. streamlit/static/static/js/index.BBPZ3wsr.js +0 -1
  167. streamlit/static/static/js/index.BKahTKEx.js +0 -3
  168. streamlit/static/static/js/index.CSGfgCnQ.js +0 -1
  169. streamlit/static/static/js/index.CYMgsYSm.js +0 -1
  170. streamlit/static/static/js/index.CZjnqbcd.js +0 -73
  171. streamlit/static/static/js/index.C_4BuzGH.js +0 -1
  172. streamlit/static/static/js/index.CjiPq39N.js +0 -1
  173. streamlit/static/static/js/index.CjuTYYFG.js +0 -1
  174. streamlit/static/static/js/index.CuH7mftz.js +0 -1
  175. streamlit/static/static/js/index.DFJg1zHB.js +0 -1
  176. streamlit/static/static/js/index.Dm3nmdhh.js +0 -1
  177. streamlit/static/static/js/index.rrDohWOh.js +0 -1
  178. streamlit/static/static/js/useBasicWidgetState.DXLMTaiS.js +0 -1
  179. streamlit/static/static/media/MaterialSymbols-Rounded.DzyB5T7Y.woff2 +0 -0
  180. {streamlit_nightly-1.41.2.dev20250201.data → streamlit_nightly-1.42.1.dev20250204.data}/scripts/streamlit.cmd +0 -0
  181. {streamlit_nightly-1.41.2.dev20250201.dist-info → streamlit_nightly-1.42.1.dev20250204.dist-info}/WHEEL +0 -0
  182. {streamlit_nightly-1.41.2.dev20250201.dist-info → streamlit_nightly-1.42.1.dev20250204.dist-info}/entry_points.txt +0 -0
  183. {streamlit_nightly-1.41.2.dev20250201.dist-info → streamlit_nightly-1.42.1.dev20250204.dist-info}/top_level.txt +0 -0
@@ -79,9 +79,18 @@ class ImageMixin:
79
79
  row of images that overflow to additional rows as needed.
80
80
  caption : str or list of str
81
81
  Image caption(s). If this is ``None`` (default), no caption is
82
- displayed. If ``image`` is a list of multiple images,
83
- ``caption`` must be a list of captions (one caption for each
84
- image) or ``None``.
82
+ displayed. If ``image`` is a list of multiple images, ``caption``
83
+ must be a list of captions (one caption for each image) or
84
+ ``None``.
85
+
86
+ Captions can optionally contain GitHub-flavored Markdown. Syntax
87
+ information can be found at: https://github.github.com/gfm.
88
+
89
+ See the ``body`` parameter of |st.markdown|_ for additional,
90
+ supported Markdown directives.
91
+
92
+ .. |st.markdown| replace:: ``st.markdown``
93
+ .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
85
94
  width : int or None
86
95
  Image width. If this is ``None`` (default), Streamlit will use the
87
96
  image's native width, up to the width of the parent container.
@@ -14,7 +14,8 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- from typing import TYPE_CHECKING, Literal, Sequence, Union, cast
17
+ from collections.abc import Sequence
18
+ from typing import TYPE_CHECKING, Literal, Union, cast
18
19
 
19
20
  from typing_extensions import TypeAlias
20
21
 
@@ -647,9 +648,13 @@ class LayoutsMixin:
647
648
  .. |st.markdown| replace:: ``st.markdown``
648
649
  .. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
649
650
 
650
- help : str
651
- An optional tooltip that gets displayed when the popover button is
652
- hovered over.
651
+ help : str or None
652
+ A tooltip that gets displayed when the popover button is hovered
653
+ over. If this is ``None`` (default), no tooltip is displayed.
654
+
655
+ The tooltip can optionally contain GitHub-flavored Markdown,
656
+ including the Markdown directives described in the ``body``
657
+ parameter of ``st.markdown``.
653
658
 
654
659
  icon : str
655
660
  An optional emoji or icon to display next to the button label. If ``icon``
@@ -16,17 +16,15 @@
16
16
 
17
17
  from __future__ import annotations
18
18
 
19
+ from collections.abc import Collection, Hashable, Sequence
19
20
  from dataclasses import dataclass
20
21
  from datetime import date
21
22
  from enum import Enum
22
23
  from typing import (
23
24
  TYPE_CHECKING,
24
25
  Any,
25
- Collection,
26
26
  Final,
27
- Hashable,
28
27
  Literal,
29
- Sequence,
30
28
  TypedDict,
31
29
  cast,
32
30
  )
@@ -14,7 +14,8 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- from typing import Any, Callable, Collection, Tuple, Union, cast
17
+ from collections.abc import Collection
18
+ from typing import Any, Callable, Union, cast
18
19
 
19
20
  from typing_extensions import TypeAlias
20
21
 
@@ -22,17 +23,17 @@ from streamlit.errors import StreamlitInvalidColorError
22
23
 
23
24
  # components go from 0.0 to 1.0
24
25
  # Supported by Pillow and pretty common.
25
- FloatRGBColorTuple: TypeAlias = Tuple[float, float, float]
26
- FloatRGBAColorTuple: TypeAlias = Tuple[float, float, float, float]
26
+ FloatRGBColorTuple: TypeAlias = tuple[float, float, float]
27
+ FloatRGBAColorTuple: TypeAlias = tuple[float, float, float, float]
27
28
 
28
29
  # components go from 0 to 255
29
30
  # DeckGL uses these.
30
- IntRGBColorTuple: TypeAlias = Tuple[int, int, int]
31
- IntRGBAColorTuple: TypeAlias = Tuple[int, int, int, int]
31
+ IntRGBColorTuple: TypeAlias = tuple[int, int, int]
32
+ IntRGBAColorTuple: TypeAlias = tuple[int, int, int, int]
32
33
 
33
34
  # components go from 0 to 255, except alpha goes from 0.0 to 1.0
34
35
  # CSS uses these.
35
- MixedRGBAColorTuple: TypeAlias = Tuple[int, int, int, float]
36
+ MixedRGBAColorTuple: TypeAlias = tuple[int, int, int, float]
36
37
 
37
38
  Color4Tuple: TypeAlias = Union[
38
39
  FloatRGBAColorTuple,
@@ -16,8 +16,9 @@ from __future__ import annotations
16
16
 
17
17
  import copy
18
18
  import json
19
+ from collections.abc import Mapping
19
20
  from enum import Enum
20
- from typing import TYPE_CHECKING, Dict, Final, Literal, Mapping, Union
21
+ from typing import TYPE_CHECKING, Final, Literal, Union
21
22
 
22
23
  from typing_extensions import TypeAlias
23
24
 
@@ -67,7 +68,7 @@ class ColumnDataKind(str, Enum):
67
68
  # The dataframe schema is a mapping from the name of the column
68
69
  # in the underlying dataframe to the column data kind.
69
70
  # The index column uses `_index` as name.
70
- DataframeSchema: TypeAlias = Dict[str, ColumnDataKind]
71
+ DataframeSchema: TypeAlias = dict[str, ColumnDataKind]
71
72
 
72
73
  # This mapping contains all editable column types mapped to the data kinds
73
74
  # that the column type is compatible for editing.
@@ -396,7 +397,7 @@ def determine_dataframe_schema(
396
397
 
397
398
 
398
399
  # A mapping of column names/IDs to column configs.
399
- ColumnConfigMapping: TypeAlias = Dict[Union[IndexIdentifierType, str], ColumnConfig]
400
+ ColumnConfigMapping: TypeAlias = dict[Union[IndexIdentifierType, str], ColumnConfig]
400
401
  ColumnConfigMappingInput: TypeAlias = Mapping[
401
402
  Union[IndexIdentifierType, str],
402
403
  Union[ColumnConfig, None, str],
@@ -15,12 +15,15 @@
15
15
  from __future__ import annotations
16
16
 
17
17
  import datetime
18
- from typing import Iterable, Literal, TypedDict
18
+ from typing import TYPE_CHECKING, Literal, TypedDict
19
19
 
20
20
  from typing_extensions import NotRequired, TypeAlias
21
21
 
22
22
  from streamlit.runtime.metrics_util import gather_metrics
23
23
 
24
+ if TYPE_CHECKING:
25
+ from collections.abc import Iterable
26
+
24
27
  ColumnWidth: TypeAlias = Literal["small", "medium", "large"]
25
28
 
26
29
  # Type alias that represents all available column types
@@ -152,8 +155,12 @@ class ColumnConfig(TypedDict, total=False):
152
155
  - ``"large"``: 400px wide
153
156
 
154
157
  help: str or None
155
- An optional tooltip that gets displayed when hovering over the column
156
- label. If this is ``None`` (default), no tooltip is displayed.
158
+ A tooltip that gets displayed when hovering over the column label. If
159
+ this is ``None`` (default), no tooltip is displayed.
160
+
161
+ The tooltip can optionally contain GitHub-flavored Markdown, including
162
+ the Markdown directives described in the ``body`` parameter of
163
+ ``st.markdown``.
157
164
 
158
165
  disabled: bool or None
159
166
  Whether editing should be disabled for this column. If this is ``None``
@@ -252,8 +259,12 @@ def Column(
252
259
  - ``"large"``: 400px wide
253
260
 
254
261
  help: str or None
255
- An optional tooltip that gets displayed when hovering over the column
256
- label. If this is ``None`` (default), no tooltip is displayed.
262
+ A tooltip that gets displayed when hovering over the column label. If
263
+ this is ``None`` (default), no tooltip is displayed.
264
+
265
+ The tooltip can optionally contain GitHub-flavored Markdown, including
266
+ the Markdown directives described in the ``body`` parameter of
267
+ ``st.markdown``.
257
268
 
258
269
  disabled: bool or None
259
270
  Whether editing should be disabled for this column. If this is ``None``
@@ -354,8 +365,12 @@ def NumberColumn(
354
365
  - ``"large"``: 400px wide
355
366
 
356
367
  help: str or None
357
- An optional tooltip that gets displayed when hovering over the column
358
- label. If this is ``None`` (default), no tooltip is displayed.
368
+ A tooltip that gets displayed when hovering over the column label. If
369
+ this is ``None`` (default), no tooltip is displayed.
370
+
371
+ The tooltip can optionally contain GitHub-flavored Markdown, including
372
+ the Markdown directives described in the ``body`` parameter of
373
+ ``st.markdown``.
359
374
 
360
375
  disabled: bool or None
361
376
  Whether editing should be disabled for this column. If this is ``None``
@@ -493,8 +508,12 @@ def TextColumn(
493
508
  - ``"large"``: 400px wide
494
509
 
495
510
  help: str or None
496
- An optional tooltip that gets displayed when hovering over the column
497
- label. If this is ``None`` (default), no tooltip is displayed.
511
+ A tooltip that gets displayed when hovering over the column label. If
512
+ this is ``None`` (default), no tooltip is displayed.
513
+
514
+ The tooltip can optionally contain GitHub-flavored Markdown, including
515
+ the Markdown directives described in the ``body`` parameter of
516
+ ``st.markdown``.
498
517
 
499
518
  disabled: bool or None
500
519
  Whether editing should be disabled for this column. If this is ``None``
@@ -613,8 +632,12 @@ def LinkColumn(
613
632
  - ``"large"``: 400px wide
614
633
 
615
634
  help: str or None
616
- An optional tooltip that gets displayed when hovering over the column
617
- label. If this is ``None`` (default), no tooltip is displayed.
635
+ A tooltip that gets displayed when hovering over the column label. If
636
+ this is ``None`` (default), no tooltip is displayed.
637
+
638
+ The tooltip can optionally contain GitHub-flavored Markdown, including
639
+ the Markdown directives described in the ``body`` parameter of
640
+ ``st.markdown``.
618
641
 
619
642
  disabled: bool or None
620
643
  Whether editing should be disabled for this column. If this is ``None``
@@ -766,8 +789,12 @@ def CheckboxColumn(
766
789
  - ``"large"``: 400px wide
767
790
 
768
791
  help: str or None
769
- An optional tooltip that gets displayed when hovering over the column
770
- label. If this is ``None`` (default), no tooltip is displayed.
792
+ A tooltip that gets displayed when hovering over the column label. If
793
+ this is ``None`` (default), no tooltip is displayed.
794
+
795
+ The tooltip can optionally contain GitHub-flavored Markdown, including
796
+ the Markdown directives described in the ``body`` parameter of
797
+ ``st.markdown``.
771
798
 
772
799
  disabled: bool or None
773
800
  Whether editing should be disabled for this column. If this is ``None``
@@ -872,8 +899,12 @@ def SelectboxColumn(
872
899
  - ``"large"``: 400px wide
873
900
 
874
901
  help: str or None
875
- An optional tooltip that gets displayed when hovering over the column
876
- label. If this is ``None`` (default), no tooltip is displayed.
902
+ A tooltip that gets displayed when hovering over the column label. If
903
+ this is ``None`` (default), no tooltip is displayed.
904
+
905
+ The tooltip can optionally contain GitHub-flavored Markdown, including
906
+ the Markdown directives described in the ``body`` parameter of
907
+ ``st.markdown``.
877
908
 
878
909
  disabled: bool or None
879
910
  Whether editing should be disabled for this column. If this is ``None``
@@ -993,8 +1024,12 @@ def BarChartColumn(
993
1024
  - ``"large"``: 400px wide
994
1025
 
995
1026
  help: str or None
996
- An optional tooltip that gets displayed when hovering over the column
997
- label. If this is ``None`` (default), no tooltip is displayed.
1027
+ A tooltip that gets displayed when hovering over the column label. If
1028
+ this is ``None`` (default), no tooltip is displayed.
1029
+
1030
+ The tooltip can optionally contain GitHub-flavored Markdown, including
1031
+ the Markdown directives described in the ``body`` parameter of
1032
+ ``st.markdown``.
998
1033
 
999
1034
  pinned: bool or None
1000
1035
  Whether the column is pinned. A pinned column will stay visible on the
@@ -1087,8 +1122,12 @@ def LineChartColumn(
1087
1122
  - ``"large"``: 400px wide
1088
1123
 
1089
1124
  help: str or None
1090
- An optional tooltip that gets displayed when hovering over the column
1091
- label. If this is ``None`` (default), no tooltip is displayed.
1125
+ A tooltip that gets displayed when hovering over the column label. If
1126
+ this is ``None`` (default), no tooltip is displayed.
1127
+
1128
+ The tooltip can optionally contain GitHub-flavored Markdown, including
1129
+ the Markdown directives described in the ``body`` parameter of
1130
+ ``st.markdown``.
1092
1131
 
1093
1132
  pinned: bool or None
1094
1133
  Whether the column is pinned. A pinned column will stay visible on the
@@ -1182,8 +1221,12 @@ def AreaChartColumn(
1182
1221
  - ``"large"``: 400px wide
1183
1222
 
1184
1223
  help: str or None
1185
- An optional tooltip that gets displayed when hovering over the column
1186
- label. If this is ``None`` (default), no tooltip is displayed.
1224
+ A tooltip that gets displayed when hovering over the column label. If
1225
+ this is ``None`` (default), no tooltip is displayed.
1226
+
1227
+ The tooltip can optionally contain GitHub-flavored Markdown, including
1228
+ the Markdown directives described in the ``body`` parameter of
1229
+ ``st.markdown``.
1187
1230
 
1188
1231
  pinned: bool or None
1189
1232
  Whether the column is pinned. A pinned column will stay visible on the
@@ -1283,8 +1326,12 @@ def ImageColumn(
1283
1326
  - ``"large"``: 400px wide
1284
1327
 
1285
1328
  help: str or None
1286
- An optional tooltip that gets displayed when hovering over the column
1287
- label. If this is ``None`` (default), no tooltip is displayed.
1329
+ A tooltip that gets displayed when hovering over the column label. If
1330
+ this is ``None`` (default), no tooltip is displayed.
1331
+
1332
+ The tooltip can optionally contain GitHub-flavored Markdown, including
1333
+ the Markdown directives described in the ``body`` parameter of
1334
+ ``st.markdown``.
1288
1335
 
1289
1336
  pinned: bool or None
1290
1337
  Whether the column is pinned. A pinned column will stay visible on the
@@ -1363,8 +1410,12 @@ def ListColumn(
1363
1410
  - ``"large"``: 400px wide
1364
1411
 
1365
1412
  help: str or None
1366
- An optional tooltip that gets displayed when hovering over the column
1367
- label. If this is ``None`` (default), no tooltip is displayed.
1413
+ A tooltip that gets displayed when hovering over the column label. If
1414
+ this is ``None`` (default), no tooltip is displayed.
1415
+
1416
+ The tooltip can optionally contain GitHub-flavored Markdown, including
1417
+ the Markdown directives described in the ``body`` parameter of
1418
+ ``st.markdown``.
1368
1419
 
1369
1420
  pinned: bool or None
1370
1421
  Whether the column is pinned. A pinned column will stay visible on the
@@ -1454,8 +1505,12 @@ def DatetimeColumn(
1454
1505
  - ``"large"``: 400px wide
1455
1506
 
1456
1507
  help: str or None
1457
- An optional tooltip that gets displayed when hovering over the column
1458
- label. If this is ``None`` (default), no tooltip is displayed.
1508
+ A tooltip that gets displayed when hovering over the column label. If
1509
+ this is ``None`` (default), no tooltip is displayed.
1510
+
1511
+ The tooltip can optionally contain GitHub-flavored Markdown, including
1512
+ the Markdown directives described in the ``body`` parameter of
1513
+ ``st.markdown``.
1459
1514
 
1460
1515
  disabled: bool or None
1461
1516
  Whether editing should be disabled for this column. If this is ``None``
@@ -1601,8 +1656,12 @@ def TimeColumn(
1601
1656
  - ``"large"``: 400px wide
1602
1657
 
1603
1658
  help: str or None
1604
- An optional tooltip that gets displayed when hovering over the column
1605
- label. If this is ``None`` (default), no tooltip is displayed.
1659
+ A tooltip that gets displayed when hovering over the column label. If
1660
+ this is ``None`` (default), no tooltip is displayed.
1661
+
1662
+ The tooltip can optionally contain GitHub-flavored Markdown, including
1663
+ the Markdown directives described in the ``body`` parameter of
1664
+ ``st.markdown``.
1606
1665
 
1607
1666
  disabled: bool or None
1608
1667
  Whether editing should be disabled for this column. If this is ``None``
@@ -1743,8 +1802,12 @@ def DateColumn(
1743
1802
  - ``"large"``: 400px wide
1744
1803
 
1745
1804
  help: str or None
1746
- An optional tooltip that gets displayed when hovering over the column
1747
- label. If this is ``None`` (default), no tooltip is displayed.
1805
+ A tooltip that gets displayed when hovering over the column label. If
1806
+ this is ``None`` (default), no tooltip is displayed.
1807
+
1808
+ The tooltip can optionally contain GitHub-flavored Markdown, including
1809
+ the Markdown directives described in the ``body`` parameter of
1810
+ ``st.markdown``.
1748
1811
 
1749
1812
  disabled: bool or None
1750
1813
  Whether editing should be disabled for this column. If this is ``None``
@@ -1880,8 +1943,12 @@ def ProgressColumn(
1880
1943
  - ``"large"``: 400px wide
1881
1944
 
1882
1945
  help: str or None
1883
- An optional tooltip that gets displayed when hovering over the column
1884
- label. If this is ``None`` (default), no tooltip is displayed.
1946
+ A tooltip that gets displayed when hovering over the column label. If
1947
+ this is ``None`` (default), no tooltip is displayed.
1948
+
1949
+ The tooltip can optionally contain GitHub-flavored Markdown, including
1950
+ the Markdown directives described in the ``body`` parameter of
1951
+ ``st.markdown``.
1885
1952
 
1886
1953
  format: str or None
1887
1954
  A printf-style format string controlling how numbers are displayed.
@@ -16,7 +16,10 @@
16
16
 
17
17
  from __future__ import annotations
18
18
 
19
- from typing import Any, Mapping
19
+ from typing import TYPE_CHECKING, Any
20
+
21
+ if TYPE_CHECKING:
22
+ from collections.abc import Mapping
20
23
 
21
24
 
22
25
  def _unflatten_single_dict(flat_dict: dict[Any, Any]) -> dict[Any, Any]:
@@ -12,10 +12,10 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- from typing import Any, Dict
15
+ from typing import Any
16
16
 
17
17
 
18
- class AttributeDictionary(Dict[Any, Any]):
18
+ class AttributeDictionary(dict[Any, Any]):
19
19
  """
20
20
  A dictionary subclass that supports attribute-style access.
21
21
 
@@ -14,7 +14,10 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- from typing import Sequence
17
+ from typing import TYPE_CHECKING
18
+
19
+ if TYPE_CHECKING:
20
+ from collections.abc import Sequence
18
21
 
19
22
  TYPE_PAIRS = [
20
23
  (".jpg", ".jpeg"),
@@ -17,9 +17,10 @@ from __future__ import annotations
17
17
  import io
18
18
  import os
19
19
  import re
20
+ from collections.abc import Sequence
20
21
  from enum import IntEnum
21
22
  from pathlib import Path
22
- from typing import TYPE_CHECKING, Final, Literal, Sequence, Union, cast
23
+ from typing import TYPE_CHECKING, Final, Literal, Union, cast
23
24
 
24
25
  from typing_extensions import TypeAlias
25
26
 
@@ -416,9 +417,9 @@ def marshall_images(
416
417
  else:
417
418
  captions = [str(caption)]
418
419
 
419
- assert isinstance(
420
- captions, list
421
- ), "If image is a list then caption should be as well"
420
+ assert isinstance(captions, list), (
421
+ "If image is a list then caption should be as well"
422
+ )
422
423
  assert len(captions) == len(images), "Cannot pair %d captions with %d images." % (
423
424
  len(captions),
424
425
  len(images),
@@ -15,7 +15,7 @@
15
15
  from __future__ import annotations
16
16
 
17
17
  from enum import Enum, EnumMeta
18
- from typing import Any, Final, Iterable, Sequence, TypeVar, overload
18
+ from typing import TYPE_CHECKING, Any, Final, TypeVar, overload
19
19
 
20
20
  from streamlit import config, logger
21
21
  from streamlit.dataframe_util import OptionSequence, convert_anything_to_list
@@ -26,6 +26,9 @@ from streamlit.type_util import (
26
26
  check_python_comparable,
27
27
  )
28
28
 
29
+ if TYPE_CHECKING:
30
+ from collections.abc import Iterable, Sequence
31
+
29
32
  _LOGGER: Final = logger.get_logger(__name__)
30
33
 
31
34
  _FLOAT_EQUALITY_EPSILON: Final[float] = 0.000000000005
@@ -14,7 +14,8 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- from typing import TYPE_CHECKING, Any, Mapping, TypeVar
17
+ from collections.abc import Mapping
18
+ from typing import TYPE_CHECKING, Any, TypeVar
18
19
 
19
20
  from streamlit import dataframe_util
20
21
  from streamlit.errors import StreamlitAPIException
@@ -14,7 +14,7 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
- from typing import TYPE_CHECKING, Any, Final, Sequence
17
+ from typing import TYPE_CHECKING, Any, Final
18
18
 
19
19
  from streamlit import config, errors, logger, runtime
20
20
  from streamlit.elements.lib.form_utils import is_in_form
@@ -31,6 +31,8 @@ from streamlit.runtime.scriptrunner_utils.script_run_context import (
31
31
  from streamlit.runtime.state import WidgetCallback, get_session_state
32
32
 
33
33
  if TYPE_CHECKING:
34
+ from collections.abc import Sequence
35
+
34
36
  from streamlit.delta_generator import DeltaGenerator
35
37
 
36
38
 
@@ -19,7 +19,6 @@ from datetime import date, datetime, time, timedelta
19
19
  from typing import (
20
20
  TYPE_CHECKING,
21
21
  Any,
22
- Iterable,
23
22
  Literal,
24
23
  Union,
25
24
  overload,
@@ -45,6 +44,7 @@ from streamlit.util import HASHLIB_KWARGS
45
44
 
46
45
  if TYPE_CHECKING:
47
46
  from builtins import ellipsis
47
+ from collections.abc import Iterable
48
48
 
49
49
 
50
50
  Key: TypeAlias = Union[str, int]
streamlit/elements/map.py CHANGED
@@ -18,7 +18,7 @@ from __future__ import annotations
18
18
 
19
19
  import copy
20
20
  import json
21
- from typing import TYPE_CHECKING, Any, Collection, Final, cast
21
+ from typing import TYPE_CHECKING, Any, Final, cast
22
22
 
23
23
  import streamlit.elements.deck_gl_json_chart as deck_gl_json_chart
24
24
  from streamlit import config, dataframe_util
@@ -33,6 +33,8 @@ from streamlit.proto.DeckGlJsonChart_pb2 import DeckGlJsonChart as DeckGlJsonCha
33
33
  from streamlit.runtime.metrics_util import gather_metrics
34
34
 
35
35
  if TYPE_CHECKING:
36
+ from collections.abc import Collection
37
+
36
38
  from pandas import DataFrame
37
39
 
38
40
  from streamlit.dataframe_util import Data
@@ -93,8 +93,13 @@ class MarkdownMixin:
93
93
  If you only want to insert HTML or CSS without Markdown text,
94
94
  we recommend using ``st.html`` instead.
95
95
 
96
- help : str
97
- An optional tooltip that gets displayed next to the Markdown.
96
+ help : str or None
97
+ A tooltip that gets displayed next to the Markdown. If this is
98
+ ``None`` (default), no tooltip is displayed.
99
+
100
+ The tooltip can optionally contain GitHub-flavored Markdown,
101
+ including the Markdown directives described in the ``body``
102
+ parameter of ``st.markdown``.
98
103
 
99
104
  Examples
100
105
  --------
@@ -162,7 +167,7 @@ class MarkdownMixin:
162
167
 
163
168
  """
164
169
  code_proto = MarkdownProto()
165
- markdown = f'```{language or ""}\n{body}\n```'
170
+ markdown = f"```{language or ''}\n{body}\n```"
166
171
  code_proto.body = clean_text(markdown)
167
172
  code_proto.element_type = MarkdownProto.Type.CODE
168
173
  return self.dg._enqueue("markdown", code_proto)
@@ -205,8 +210,13 @@ class MarkdownMixin:
205
210
  If you only want to insert HTML or CSS without Markdown text,
206
211
  we recommend using ``st.html`` instead.
207
212
 
208
- help : str
209
- An optional tooltip that gets displayed next to the caption.
213
+ help : str or None
214
+ A tooltip that gets displayed next to the caption. If this is
215
+ ``None`` (default), no tooltip is displayed.
216
+
217
+ The tooltip can optionally contain GitHub-flavored Markdown,
218
+ including the Markdown directives described in the ``body``
219
+ parameter of ``st.markdown``.
210
220
 
211
221
  Examples
212
222
  --------
@@ -246,9 +256,13 @@ class MarkdownMixin:
246
256
  a good idea to use raw Python strings since LaTeX uses backslashes
247
257
  a lot.
248
258
 
249
- help : str
250
- An optional tooltip that gets displayed next to the LaTeX expression.
259
+ help : str or None
260
+ A tooltip that gets displayed next to the LaTeX expression. If
261
+ this is ``None`` (default), no tooltip is displayed.
251
262
 
263
+ The tooltip can optionally contain GitHub-flavored Markdown,
264
+ including the Markdown directives described in the ``body``
265
+ parameter of ``st.markdown``.
252
266
 
253
267
  Example
254
268
  -------
@@ -18,7 +18,7 @@ import io
18
18
  import re
19
19
  from datetime import timedelta
20
20
  from pathlib import Path
21
- from typing import TYPE_CHECKING, Dict, Final, Union, cast
21
+ from typing import TYPE_CHECKING, Final, Union, cast
22
22
 
23
23
  from typing_extensions import TypeAlias
24
24
 
@@ -54,7 +54,7 @@ MediaData: TypeAlias = Union[
54
54
  ]
55
55
 
56
56
  SubtitleData: TypeAlias = Union[
57
- str, Path, bytes, io.BytesIO, Dict[str, Union[str, Path, bytes, io.BytesIO]], None
57
+ str, Path, bytes, io.BytesIO, dict[str, Union[str, Path, bytes, io.BytesIO]], None
58
58
  ]
59
59
 
60
60
  MediaTime: TypeAlias = Union[int, float, timedelta, str]
@@ -102,10 +102,14 @@ class MetricMixin:
102
102
  good, e.g. if cost decreased. If "off", delta is shown in gray
103
103
  regardless of its value.
104
104
 
105
- help : str
106
- An optional tooltip that gets displayed next to the metric label.
107
- Streamlit only displays the tooltip when
108
- ``label_visibility="visible"``.
105
+ help : str or None
106
+ A tooltip that gets displayed next to the metric label. Streamlit
107
+ only displays the tooltip when ``label_visibility="visible"``. If
108
+ this is ``None`` (default), no tooltip is displayed.
109
+
110
+ The tooltip can optionally contain GitHub-flavored Markdown,
111
+ including the Markdown directives described in the ``body``
112
+ parameter of ``st.markdown``.
109
113
 
110
114
  label_visibility : "visible", "hidden", or "collapsed"
111
115
  The visibility of the label. The default is ``"visible"``. If this
@@ -21,10 +21,7 @@ from dataclasses import dataclass
21
21
  from typing import (
22
22
  TYPE_CHECKING,
23
23
  Any,
24
- Dict,
25
24
  Final,
26
- Iterable,
27
- List,
28
25
  Literal,
29
26
  TypedDict,
30
27
  Union,
@@ -50,6 +47,8 @@ from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_r
50
47
  from streamlit.runtime.state import WidgetCallback, register_widget
51
48
 
52
49
  if TYPE_CHECKING:
50
+ from collections.abc import Iterable
51
+
53
52
  import matplotlib
54
53
  import plotly.graph_objs as go
55
54
  from plotly.basedatatypes import BaseFigure
@@ -65,11 +64,11 @@ _AtomicFigureOrData: TypeAlias = Union[
65
64
  ]
66
65
  FigureOrData: TypeAlias = Union[
67
66
  _AtomicFigureOrData,
68
- List[_AtomicFigureOrData],
67
+ list[_AtomicFigureOrData],
69
68
  # It is kind of hard to figure out exactly what kind of dict is supported
70
69
  # here, as plotly hasn't embraced typing yet. This version is chosen to
71
70
  # align with the docstring.
72
- Dict[str, _AtomicFigureOrData],
71
+ dict[str, _AtomicFigureOrData],
73
72
  "BaseFigure",
74
73
  "matplotlib.figure.Figure",
75
74
  ]