streamlit 1.51.0__py3-none-any.whl → 1.52.1__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 (314) hide show
  1. streamlit/__init__.py +1 -0
  2. streamlit/commands/execution_control.py +89 -14
  3. streamlit/components/v1/component_arrow.py +7 -7
  4. streamlit/components/v2/__init__.py +59 -3
  5. streamlit/components/v2/bidi_component/main.py +161 -13
  6. streamlit/components/v2/bidi_component/serialization.py +13 -6
  7. streamlit/components/v2/component_manager.py +11 -3
  8. streamlit/components/v2/component_registry.py +18 -1
  9. streamlit/components/v2/types.py +2 -2
  10. streamlit/connections/snowflake_connection.py +1 -1
  11. streamlit/connections/snowpark_connection.py +1 -1
  12. streamlit/dataframe_util.py +18 -18
  13. streamlit/delta_generator.py +7 -0
  14. streamlit/delta_generator_singletons.py +8 -14
  15. streamlit/elements/alert.py +16 -0
  16. streamlit/elements/arrow.py +36 -6
  17. streamlit/elements/bokeh_chart.py +10 -78
  18. streamlit/elements/code.py +2 -2
  19. streamlit/elements/deck_gl_json_chart.py +1 -1
  20. streamlit/elements/exception.py +1 -1
  21. streamlit/elements/form.py +27 -0
  22. streamlit/elements/heading.py +60 -5
  23. streamlit/elements/html.py +13 -2
  24. streamlit/elements/image.py +1 -1
  25. streamlit/elements/layouts.py +28 -22
  26. streamlit/elements/lib/built_in_chart_utils.py +49 -16
  27. streamlit/elements/lib/color_util.py +1 -1
  28. streamlit/elements/lib/column_config_utils.py +6 -5
  29. streamlit/elements/lib/layout_utils.py +50 -0
  30. streamlit/elements/lib/pandas_styler_utils.py +17 -9
  31. streamlit/elements/lib/shortcut_utils.py +152 -0
  32. streamlit/elements/markdown.py +50 -3
  33. streamlit/elements/metric.py +31 -1
  34. streamlit/elements/plotly_chart.py +75 -6
  35. streamlit/elements/spinner.py +1 -1
  36. streamlit/elements/text.py +20 -3
  37. streamlit/elements/toast.py +2 -0
  38. streamlit/elements/vega_charts.py +17 -1
  39. streamlit/elements/widgets/audio_input.py +8 -7
  40. streamlit/elements/widgets/button.py +279 -40
  41. streamlit/elements/widgets/button_group.py +27 -2
  42. streamlit/elements/widgets/camera_input.py +1 -1
  43. streamlit/elements/widgets/chat.py +300 -42
  44. streamlit/elements/widgets/color_picker.py +7 -0
  45. streamlit/elements/widgets/data_editor.py +68 -28
  46. streamlit/elements/widgets/file_uploader.py +4 -1
  47. streamlit/elements/widgets/number_input.py +2 -0
  48. streamlit/elements/widgets/text_widgets.py +2 -0
  49. streamlit/elements/widgets/time_widgets.py +581 -9
  50. streamlit/errors.py +22 -0
  51. streamlit/git_util.py +1 -1
  52. streamlit/navigation/page.py +7 -0
  53. streamlit/net_util.py +2 -2
  54. streamlit/proto/Alert_pb2.pyi +3 -3
  55. streamlit/proto/AppPage_pb2.pyi +7 -1
  56. streamlit/proto/ArrowData_pb2.pyi +7 -1
  57. streamlit/proto/ArrowNamedDataSet_pb2.pyi +7 -1
  58. streamlit/proto/ArrowVegaLiteChart_pb2.pyi +7 -1
  59. streamlit/proto/Arrow_pb2.py +10 -10
  60. streamlit/proto/Arrow_pb2.pyi +19 -12
  61. streamlit/proto/AudioInput_pb2.pyi +7 -1
  62. streamlit/proto/Audio_pb2.pyi +7 -1
  63. streamlit/proto/AuthRedirect_pb2.pyi +7 -1
  64. streamlit/proto/AutoRerun_pb2.pyi +7 -1
  65. streamlit/proto/BackMsg_pb2.py +4 -2
  66. streamlit/proto/BackMsg_pb2.pyi +34 -4
  67. streamlit/proto/Balloons_pb2.pyi +7 -1
  68. streamlit/proto/BidiComponent_pb2.pyi +10 -4
  69. streamlit/proto/Block_pb2.pyi +35 -35
  70. streamlit/proto/BokehChart_pb2.pyi +7 -1
  71. streamlit/proto/ButtonGroup_pb2.pyi +9 -9
  72. streamlit/proto/Button_pb2.py +2 -2
  73. streamlit/proto/Button_pb2.pyi +11 -2
  74. streamlit/proto/CameraInput_pb2.pyi +7 -1
  75. streamlit/proto/ChatInput_pb2.py +6 -6
  76. streamlit/proto/ChatInput_pb2.pyi +18 -6
  77. streamlit/proto/Checkbox_pb2.pyi +3 -3
  78. streamlit/proto/ClientState_pb2.pyi +10 -4
  79. streamlit/proto/Code_pb2.pyi +7 -1
  80. streamlit/proto/ColorPicker_pb2.pyi +7 -1
  81. streamlit/proto/Common_pb2.py +3 -3
  82. streamlit/proto/Common_pb2.pyi +35 -23
  83. streamlit/proto/Components_pb2.pyi +19 -13
  84. streamlit/proto/DataFrame_pb2.pyi +55 -49
  85. streamlit/proto/DateInput_pb2.pyi +7 -1
  86. streamlit/proto/DateTimeInput_pb2.py +28 -0
  87. streamlit/proto/DateTimeInput_pb2.pyi +92 -0
  88. streamlit/proto/DeckGlJsonChart_pb2.pyi +3 -3
  89. streamlit/proto/Delta_pb2.pyi +7 -1
  90. streamlit/proto/DocString_pb2.pyi +10 -4
  91. streamlit/proto/DownloadButton_pb2.py +2 -2
  92. streamlit/proto/DownloadButton_pb2.pyi +16 -2
  93. streamlit/proto/Element_pb2.py +5 -3
  94. streamlit/proto/Element_pb2.pyi +23 -5
  95. streamlit/proto/Empty_pb2.pyi +7 -1
  96. streamlit/proto/Exception_pb2.pyi +7 -1
  97. streamlit/proto/Favicon_pb2.pyi +7 -1
  98. streamlit/proto/FileUploader_pb2.pyi +7 -1
  99. streamlit/proto/ForwardMsg_pb2.py +12 -10
  100. streamlit/proto/ForwardMsg_pb2.pyi +42 -15
  101. streamlit/proto/GapSize_pb2.pyi +4 -4
  102. streamlit/proto/GitInfo_pb2.pyi +3 -3
  103. streamlit/proto/GraphVizChart_pb2.pyi +7 -1
  104. streamlit/proto/Heading_pb2.pyi +7 -1
  105. streamlit/proto/HeightConfig_pb2.pyi +7 -1
  106. streamlit/proto/Html_pb2.py +2 -2
  107. streamlit/proto/Html_pb2.pyi +11 -2
  108. streamlit/proto/IFrame_pb2.pyi +7 -1
  109. streamlit/proto/Image_pb2.pyi +10 -4
  110. streamlit/proto/Json_pb2.pyi +7 -1
  111. streamlit/proto/LabelVisibilityMessage_pb2.pyi +3 -3
  112. streamlit/proto/LinkButton_pb2.py +2 -2
  113. streamlit/proto/LinkButton_pb2.pyi +15 -2
  114. streamlit/proto/Logo_pb2.pyi +7 -1
  115. streamlit/proto/Markdown_pb2.pyi +3 -3
  116. streamlit/proto/Metric_pb2.pyi +7 -7
  117. streamlit/proto/MetricsEvent_pb2.pyi +10 -4
  118. streamlit/proto/MultiSelect_pb2.pyi +7 -1
  119. streamlit/proto/NamedDataSet_pb2.pyi +7 -1
  120. streamlit/proto/Navigation_pb2.pyi +3 -3
  121. streamlit/proto/NewSession_pb2.pyi +40 -40
  122. streamlit/proto/NumberInput_pb2.pyi +3 -3
  123. streamlit/proto/PageConfig_pb2.pyi +7 -7
  124. streamlit/proto/PageInfo_pb2.pyi +7 -1
  125. streamlit/proto/PageLink_pb2.py +2 -2
  126. streamlit/proto/PageLink_pb2.pyi +11 -2
  127. streamlit/proto/PageNotFound_pb2.pyi +7 -1
  128. streamlit/proto/PageProfile_pb2.pyi +13 -7
  129. streamlit/proto/PagesChanged_pb2.pyi +7 -1
  130. streamlit/proto/ParentMessage_pb2.pyi +7 -1
  131. streamlit/proto/PlotlyChart_pb2.pyi +6 -6
  132. streamlit/proto/Progress_pb2.pyi +7 -1
  133. streamlit/proto/Radio_pb2.pyi +7 -1
  134. streamlit/proto/RootContainer_pb2.pyi +1 -1
  135. streamlit/proto/Selectbox_pb2.pyi +7 -1
  136. streamlit/proto/SessionEvent_pb2.pyi +7 -1
  137. streamlit/proto/SessionStatus_pb2.pyi +7 -1
  138. streamlit/proto/Skeleton_pb2.pyi +3 -3
  139. streamlit/proto/Slider_pb2.pyi +5 -5
  140. streamlit/proto/Snow_pb2.pyi +7 -1
  141. streamlit/proto/Space_pb2.pyi +7 -1
  142. streamlit/proto/Spinner_pb2.pyi +7 -1
  143. streamlit/proto/TextAlignmentConfig_pb2.py +29 -0
  144. streamlit/proto/TextAlignmentConfig_pb2.pyi +68 -0
  145. streamlit/proto/TextArea_pb2.pyi +7 -1
  146. streamlit/proto/TextInput_pb2.pyi +3 -3
  147. streamlit/proto/Text_pb2.pyi +7 -1
  148. streamlit/proto/TimeInput_pb2.pyi +7 -1
  149. streamlit/proto/Toast_pb2.pyi +7 -1
  150. streamlit/proto/VegaLiteChart_pb2.pyi +7 -1
  151. streamlit/proto/Video_pb2.pyi +6 -6
  152. streamlit/proto/WidgetStates_pb2.pyi +10 -4
  153. streamlit/proto/WidthConfig_pb2.pyi +7 -1
  154. streamlit/proto/openmetrics_data_model_pb2.pyi +52 -52
  155. streamlit/runtime/app_session.py +38 -1
  156. streamlit/runtime/caching/cache_data_api.py +1 -1
  157. streamlit/runtime/caching/cache_resource_api.py +2 -2
  158. streamlit/runtime/caching/cache_utils.py +1 -1
  159. streamlit/runtime/caching/hashing.py +1 -1
  160. streamlit/runtime/download_data_util.py +53 -0
  161. streamlit/runtime/forward_msg_queue.py +1 -0
  162. streamlit/runtime/media_file_manager.py +178 -2
  163. streamlit/runtime/metrics_util.py +87 -3
  164. streamlit/runtime/scriptrunner/script_runner.py +3 -1
  165. streamlit/runtime/state/query_params.py +80 -29
  166. streamlit/runtime/state/session_state.py +2 -2
  167. streamlit/static/index.html +1 -1
  168. streamlit/static/manifest.json +530 -229
  169. streamlit/static/static/js/{ErrorOutline.esm.YoJdlW1p.js → ErrorOutline.esm.sMJdFExW.js} +1 -1
  170. streamlit/static/static/js/{FileDownload.esm.Ddx8VEYy.js → FileDownload.esm.CV-WYqBn.js} +1 -1
  171. streamlit/static/static/js/{FileHelper.90EtOmj9.js → FileHelper.5nCh9KDY.js} +3 -3
  172. streamlit/static/static/js/{FormClearHelper.BB1Km6eP.js → FormClearHelper.-9RbsnV0.js} +1 -1
  173. streamlit/static/static/js/IFrameUtil.DefezniK.js +1 -0
  174. streamlit/static/static/js/InputInstructions.2R3tBtW9.js +1 -0
  175. streamlit/static/static/js/Particles.DDHoXFxh.js +1 -0
  176. streamlit/static/static/js/{ProgressBar.DLY8H6nE.js → ProgressBar.BxmfHxKu.js} +2 -2
  177. streamlit/static/static/js/StreamlitSyntaxHighlighter.BFWV0oqR.js +20 -0
  178. streamlit/static/static/js/{Toolbar.D8nHCkuz.js → Toolbar.DMgU0Vgw.js} +1 -1
  179. streamlit/static/static/js/_arrayIncludes.B19Iyn2B.js +1 -0
  180. streamlit/static/static/js/_baseIndexOf.BTknn6Gb.js +1 -0
  181. streamlit/static/static/js/{base-input.CJGiNqed.js → base-input.BXTqYbyG.js} +4 -4
  182. streamlit/static/static/js/{checkbox.Cpdd482O.js → checkbox.5xWaqPqm.js} +1 -1
  183. streamlit/static/static/js/{createSuper.CuQIogbW.js → createSuper.OIgV8wc-.js} +1 -1
  184. streamlit/static/static/js/data-grid-overlay-editor.B4RIu9cw.js +1 -0
  185. streamlit/static/static/js/{downloader.CN0K7xlu.js → downloader.DwCJck8O.js} +1 -1
  186. streamlit/static/static/js/embed.HKcgTiLB.js +195 -0
  187. streamlit/static/static/js/{es6.BJcsVXQ0.js → es6.4AP97RGk.js} +2 -2
  188. streamlit/static/static/js/{iframeResizer.contentWindow.XzUvQqcZ.js → iframeResizer.contentWindow.BZAsvL9q.js} +1 -1
  189. streamlit/static/static/js/index.-3selq_5.js +2 -0
  190. streamlit/static/static/js/index.1ylynMAS.js +7 -0
  191. streamlit/static/static/js/{index.CxIUUfab.js → index.6UunrySF.js} +53 -122
  192. streamlit/static/static/js/index.8HslT92O.js +14 -0
  193. streamlit/static/static/js/index.B0TPxAZ1.js +1 -0
  194. streamlit/static/static/js/index.B0yp3bM1.js +6 -0
  195. streamlit/static/static/js/index.BHWBaOWH.js +1 -0
  196. streamlit/static/static/js/index.BJas6XzW.js +1 -0
  197. streamlit/static/static/js/index.BKIlG7Ng.js +3 -0
  198. streamlit/static/static/js/index.BMU6zZRk.js +1 -0
  199. streamlit/static/static/js/index.BNMLO-0p.js +2 -0
  200. streamlit/static/static/js/index.BPmBNTel.js +1 -0
  201. streamlit/static/static/js/index.BVuohWM1.js +1 -0
  202. streamlit/static/static/js/index.B_AvdOKC.js +1 -0
  203. streamlit/static/static/js/index.BjQIH-3U.js +1 -0
  204. streamlit/static/static/js/index.BrqtKtSu.js +2 -0
  205. streamlit/static/static/js/index.Buc7XrOl.js +188 -0
  206. streamlit/static/static/js/index.CIC9pLsG.js +2 -0
  207. streamlit/static/static/js/index.CP2YZ73v.js +1 -0
  208. streamlit/static/static/js/index.CSbah0y4.js +27 -0
  209. streamlit/static/static/js/index.CbiYVMT1.js +1 -0
  210. streamlit/static/static/js/index.CbxllBj8.js +1 -0
  211. streamlit/static/static/js/index.Cd1D2eGF.js +263 -0
  212. streamlit/static/static/js/index.Ckcqwai8.js +2 -0
  213. streamlit/static/static/js/index.CqTPbV5Y.js +151 -0
  214. streamlit/static/static/js/index.CxXo5UKy.js +1 -0
  215. streamlit/static/static/js/index.CxbL5FgL.js +1 -0
  216. streamlit/static/static/js/index.D52dMvK5.js +1 -0
  217. streamlit/static/static/js/index.DBUdji-9.js +3 -0
  218. streamlit/static/static/js/index.DMU3coc2.js +1 -0
  219. streamlit/static/static/js/index.DN4sfQLP.js +1 -0
  220. streamlit/static/static/js/{index.DPUXkcQL.js → index.DRDE9rnx.js} +1 -1
  221. streamlit/static/static/js/{index.B_dWA3vd.js → index.DY9Ac89e.js} +2 -2
  222. streamlit/static/static/js/index.DYKCsDvl.js +1 -0
  223. streamlit/static/static/js/index.Da9gznCC.js +1 -0
  224. streamlit/static/static/js/index.DfIRibXG.js +1 -0
  225. streamlit/static/static/js/{index.D3GPA5k4.js → index.Dg5zbEp2.js} +9 -40
  226. streamlit/static/static/js/index.Di9I2cid.js +1 -0
  227. streamlit/static/static/js/index.DkpEv0uV.js +1 -0
  228. streamlit/static/static/js/index.DwJ9Vhsl.js +1 -0
  229. streamlit/static/static/js/index.L7erTnMm.js +1 -0
  230. streamlit/static/static/js/{index.DOFlg3dS.js → index.NaDyAN1s.js} +1 -1
  231. streamlit/static/static/js/index.RNTPpVde.js +1 -0
  232. streamlit/static/static/js/index.VFDFuf_7.js +1 -0
  233. streamlit/static/static/js/index.W-bl3NDo.js +1 -0
  234. streamlit/static/static/js/index.XYozEjwK.js +1 -0
  235. streamlit/static/static/js/index.oyLQ4pue.js +1 -0
  236. streamlit/static/static/js/index.q4fLUQtC.js +11 -0
  237. streamlit/static/static/js/index.q9puCQgK.js +2 -0
  238. streamlit/static/static/js/index.xZBTXGNC.js +1 -0
  239. streamlit/static/static/js/{input.D4MN_FzN.js → input.CcvrgErO.js} +2 -2
  240. streamlit/static/static/js/main.eVHOp4Th.js +13 -0
  241. streamlit/static/static/js/{memory.DrZjtdGT.js → memory.Ck_sLv5Y.js} +1 -1
  242. streamlit/static/static/js/moment.C3j7ZXd7.js +4 -0
  243. streamlit/static/static/js/number-overlay-editor.DgcLMWOy.js +9 -0
  244. streamlit/static/static/js/pandasStylerUtils.DqP0h70z.js +1 -0
  245. streamlit/static/static/js/{possibleConstructorReturn.exeeJQEP.js → possibleConstructorReturn.C_51n46K.js} +1 -1
  246. streamlit/static/static/js/{sandbox.ClO3IuUr.js → sandbox.Q-g3QIZJ.js} +1 -1
  247. streamlit/static/static/js/styled-components.e0V96rJw.js +1 -0
  248. streamlit/static/static/js/threshold.Q1mXg5rX.js +1 -0
  249. streamlit/static/static/js/throttle.D3b5WILl.js +1 -0
  250. streamlit/static/static/js/{timepicker.DAhu-vcF.js → timepicker.Bpn70xGc.js} +1 -1
  251. streamlit/static/static/js/timer.C2hYhUse.js +1 -0
  252. streamlit/static/static/js/{toConsumableArray.DNbljYEC.js → toConsumableArray.DIN_ys1J.js} +1 -1
  253. streamlit/static/static/js/uniqueId.B27POWT6.js +1 -0
  254. streamlit/static/static/js/urls.BwSlolu9.js +1 -0
  255. streamlit/static/static/js/{useBasicWidgetState.D6sOH6oI.js → useBasicWidgetState.DA3_qaXD.js} +1 -1
  256. streamlit/static/static/js/useIntlLocale.BSq6SANa.js +12 -0
  257. streamlit/static/static/js/{useTextInputAutoExpand.4u3_GcuN.js → useTextInputAutoExpand.ytEW5QmA.js} +1 -1
  258. streamlit/static/static/js/useUpdateUiValue.DOxWBNiI.js +1 -0
  259. streamlit/static/static/js/useWaveformController.BCmk6WLk.js +1 -0
  260. streamlit/static/static/js/value.B4vHRSi7.js +1 -0
  261. streamlit/static/static/js/withCalculatedWidth.ChdrMItN.js +1 -0
  262. streamlit/static/static/js/withFullScreenWrapper.7j_lzlaF.js +1 -0
  263. streamlit/string_util.py +8 -1
  264. streamlit/testing/v1/app_test.py +15 -0
  265. streamlit/testing/v1/element_tree.py +62 -0
  266. streamlit/web/bootstrap.py +24 -0
  267. streamlit/web/server/oauth_authlib_routes.py +5 -2
  268. streamlit/web/server/upload_file_request_handler.py +16 -0
  269. {streamlit-1.51.0.dist-info → streamlit-1.52.1.dist-info}/METADATA +9 -5
  270. {streamlit-1.51.0.dist-info → streamlit-1.52.1.dist-info}/RECORD +274 -239
  271. streamlit/static/static/js/InputInstructions.jhH15PqV.js +0 -1
  272. streamlit/static/static/js/Particles.DUsputn1.js +0 -1
  273. streamlit/static/static/js/data-grid-overlay-editor.2Ufgxc6y.js +0 -1
  274. streamlit/static/static/js/index.B1ZQh4P1.js +0 -1
  275. streamlit/static/static/js/index.BKstZk0M.js +0 -27
  276. streamlit/static/static/js/index.BMcFsUee.js +0 -1
  277. streamlit/static/static/js/index.BR-IdcTb.js +0 -2
  278. streamlit/static/static/js/index.BgnZEMVh.js +0 -1
  279. streamlit/static/static/js/index.BohqXifI.js +0 -1
  280. streamlit/static/static/js/index.Br5nxKNj.js +0 -2
  281. streamlit/static/static/js/index.BrIKVbNc.js +0 -3
  282. streamlit/static/static/js/index.BtWUPzle.js +0 -1
  283. streamlit/static/static/js/index.C0RLraek.js +0 -1
  284. streamlit/static/static/js/index.CAIjskgG.js +0 -1
  285. streamlit/static/static/js/index.CAj-7vWz.js +0 -949
  286. streamlit/static/static/js/index.CMtEit2O.js +0 -1
  287. streamlit/static/static/js/index.CkRlykEE.js +0 -12
  288. streamlit/static/static/js/index.CmN3FXfI.js +0 -1617
  289. streamlit/static/static/js/index.CwbFI1_-.js +0 -1
  290. streamlit/static/static/js/index.D2KPNy7e.js +0 -1
  291. streamlit/static/static/js/index.DGAh7DMq.js +0 -1
  292. streamlit/static/static/js/index.DKb_NvmG.js +0 -197
  293. streamlit/static/static/js/index.DMqgUYKq.js +0 -1
  294. streamlit/static/static/js/index.DX1xY89g.js +0 -1
  295. streamlit/static/static/js/index.DYATBCsq.js +0 -2
  296. streamlit/static/static/js/index.DaSmGJ76.js +0 -3
  297. streamlit/static/static/js/index.Dd7bMeLP.js +0 -1
  298. streamlit/static/static/js/index.DjmmgI5U.js +0 -1
  299. streamlit/static/static/js/index.Dq56CyM2.js +0 -1
  300. streamlit/static/static/js/index.DuiXaS5_.js +0 -7
  301. streamlit/static/static/js/index.DvFidMLe.js +0 -2
  302. streamlit/static/static/js/index.DwkhC5Pc.js +0 -1
  303. streamlit/static/static/js/index.Q-3sFn1v.js +0 -1
  304. streamlit/static/static/js/index.QJ5QO9sJ.js +0 -1
  305. streamlit/static/static/js/index.VwTaeety.js +0 -1
  306. streamlit/static/static/js/index.YOqQbeX8.js +0 -1
  307. streamlit/static/static/js/number-overlay-editor.DRwAw1In.js +0 -9
  308. streamlit/static/static/js/uniqueId.oG4Gvj1v.js +0 -1
  309. streamlit/static/static/js/useUpdateUiValue.F2R3eTeR.js +0 -1
  310. streamlit/static/static/js/withFullScreenWrapper.zothJIsI.js +0 -1
  311. {streamlit-1.51.0.data → streamlit-1.52.1.data}/scripts/streamlit.cmd +0 -0
  312. {streamlit-1.51.0.dist-info → streamlit-1.52.1.dist-info}/WHEEL +0 -0
  313. {streamlit-1.51.0.dist-info → streamlit-1.52.1.dist-info}/entry_points.txt +0 -0
  314. {streamlit-1.51.0.dist-info → streamlit-1.52.1.dist-info}/top_level.txt +0 -0
@@ -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):
@@ -177,9 +177,9 @@ OptionSequence: TypeAlias = (
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.
@@ -566,13 +566,13 @@ def convert_anything_to_pandas_df(
566
566
  import pandas as pd
567
567
 
568
568
  if isinstance(data, pd.DataFrame):
569
- return data.copy() if ensure_copy else cast("pd.DataFrame", data)
569
+ return data.copy() if ensure_copy else data
570
570
 
571
571
  if isinstance(data, (pd.Series, pd.Index, pd.api.extensions.ExtensionArray)):
572
572
  return pd.DataFrame(data)
573
573
 
574
574
  if is_pandas_styler(data):
575
- 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
576
576
 
577
577
  if isinstance(data, np.ndarray):
578
578
  return (
@@ -583,11 +583,11 @@ def convert_anything_to_pandas_df(
583
583
 
584
584
  if is_polars_dataframe(data):
585
585
  data = data.clone() if ensure_copy else data
586
- return data.to_pandas()
586
+ return cast("pd.DataFrame", data.to_pandas())
587
587
 
588
588
  if is_polars_series(data):
589
589
  data = data.clone() if ensure_copy else data
590
- return data.to_pandas().to_frame()
590
+ return cast("pd.DataFrame", data.to_pandas().to_frame())
591
591
 
592
592
  if is_polars_lazyframe(data):
593
593
  data = data.limit(max_unevaluated_rows).collect().to_pandas()
@@ -601,12 +601,12 @@ def convert_anything_to_pandas_df(
601
601
  if is_xarray_dataset(data):
602
602
  if ensure_copy:
603
603
  data = data.copy(deep=True)
604
- return data.to_dataframe()
604
+ return cast("pd.DataFrame", data.to_dataframe())
605
605
 
606
606
  if is_xarray_data_array(data):
607
607
  if ensure_copy:
608
608
  data = data.copy(deep=True)
609
- return data.to_series().to_frame()
609
+ return cast("pd.DataFrame", data.to_series().to_frame())
610
610
 
611
611
  if is_dask_object(data):
612
612
  data = data.head(max_unevaluated_rows, compute=True)
@@ -684,7 +684,7 @@ def convert_anything_to_pandas_df(
684
684
  f"⚠️ Showing only {string_util.simplify_number(max_unevaluated_rows)} "
685
685
  "rows. Call `df()` on the relation to show more."
686
686
  )
687
- return data
687
+ return cast("pd.DataFrame", data)
688
688
 
689
689
  if is_dbapi_cursor(data):
690
690
  # Based on the specification, the first item in the description is the
@@ -698,7 +698,7 @@ def convert_anything_to_pandas_df(
698
698
  f"⚠️ Showing only {string_util.simplify_number(max_unevaluated_rows)} "
699
699
  "rows. Call `fetchall()` on the Cursor to show more."
700
700
  )
701
- return data
701
+ return cast("DataFrame", data) # ty: ignore[redundant-cast]
702
702
 
703
703
  if is_snowpark_row_list(data):
704
704
  return pd.DataFrame([row.as_dict() for row in data])
@@ -727,7 +727,7 @@ def convert_anything_to_pandas_df(
727
727
  f"⚠️ Showing only {string_util.simplify_number(max_unevaluated_rows)} "
728
728
  "rows. Convert the data to a list to show more."
729
729
  )
730
- return data
730
+ return cast("DataFrame", data) # ty: ignore[redundant-cast]
731
731
 
732
732
  if isinstance(data, EnumMeta):
733
733
  # Support for enum classes
@@ -859,7 +859,7 @@ def convert_arrow_bytes_to_pandas_df(source: bytes) -> DataFrame:
859
859
  import pyarrow as pa
860
860
 
861
861
  reader = pa.RecordBatchStreamReader(source)
862
- return reader.read_pandas()
862
+ return cast("DataFrame", reader.read_pandas())
863
863
 
864
864
 
865
865
  def _show_data_information(msg: str) -> None:
@@ -1040,7 +1040,7 @@ def _maybe_truncate_table(
1040
1040
  return table
1041
1041
 
1042
1042
 
1043
- def is_colum_type_arrow_incompatible(column: Series[Any] | Index) -> bool:
1043
+ def is_colum_type_arrow_incompatible(column: Series[Any] | Index[Any]) -> bool:
1044
1044
  """Return True if the column type is known to cause issues during
1045
1045
  Arrow conversion.
1046
1046
  """
@@ -1281,7 +1281,7 @@ def _unify_missing_values(df: DataFrame) -> DataFrame:
1281
1281
  # then infer objects without creating a separate copy:
1282
1282
  # For performance reasons, we could use copy=False here.
1283
1283
  # However, this is only available in pandas >=2.
1284
- 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
1285
1285
 
1286
1286
 
1287
1287
  def _pandas_df_to_series(df: DataFrame) -> Series[Any]:
@@ -1297,7 +1297,7 @@ def _pandas_df_to_series(df: DataFrame) -> Series[Any]:
1297
1297
  raise ValueError(
1298
1298
  f"DataFrame is expected to have a single column but has {len(df.columns)}."
1299
1299
  )
1300
- return df[df.columns[0]]
1300
+ return df.iloc[:, 0]
1301
1301
 
1302
1302
 
1303
1303
  def convert_pandas_df_to_data_format(
@@ -1404,7 +1404,7 @@ def convert_pandas_df_to_data_format(
1404
1404
  return_list = []
1405
1405
  if len(df.columns) == 1:
1406
1406
  # Get the first column and convert to list
1407
- return_list = df[df.columns[0]].tolist()
1407
+ return_list = df.iloc[:, 0].tolist()
1408
1408
  elif len(df.columns) >= 1:
1409
1409
  raise ValueError(
1410
1410
  "DataFrame is expected to have a single column but "
@@ -64,7 +64,9 @@ from streamlit.elements.layouts import LayoutsMixin
64
64
  from streamlit.elements.lib.form_utils import FormData, current_form_id
65
65
  from streamlit.elements.lib.layout_utils import (
66
66
  get_height_config,
67
+ get_text_alignment_config,
67
68
  get_width_config,
69
+ validate_text_alignment,
68
70
  )
69
71
  from streamlit.elements.map import MapMixin
70
72
  from streamlit.elements.markdown import MarkdownMixin
@@ -495,6 +497,11 @@ class DeltaGenerator(
495
497
  msg.delta.new_element.width_config.CopyFrom(
496
498
  get_width_config(layout_config.width)
497
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
+ )
498
505
 
499
506
  # Only enqueue message and fill in metadata if there's a container.
500
507
  msg_was_enqueued = False
@@ -145,28 +145,22 @@ class ContextVarWithLazyDefault(Generic[_T]):
145
145
  self._default = default
146
146
  self._context_var: ContextVar[_T] | None = None
147
147
 
148
- def _init_context_var(self) -> None:
149
- self._context_var = ContextVar(self._name, default=self._default()) # noqa: B039
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
150
152
 
151
153
  def get(self) -> _T:
152
- if self._context_var is None:
153
- self._init_context_var()
154
- return self._context_var.get() # type: ignore[union-attr]
154
+ return self._ensure_context_var().get()
155
155
 
156
156
  def set(self, value: _T) -> Token[_T]:
157
- if self._context_var is None:
158
- self._init_context_var()
159
- return self._context_var.set(value) # type: ignore[union-attr]
157
+ return self._ensure_context_var().set(value)
160
158
 
161
159
  def reset(self, token: Token[_T]) -> None:
162
- if self._context_var is None:
163
- self._init_context_var()
164
- self._context_var.reset(token) # type: ignore[union-attr]
160
+ self._ensure_context_var().reset(token)
165
161
 
166
162
  def __hash__(self) -> int:
167
- if self._context_var is None:
168
- self._init_context_var()
169
- return self._context_var.__hash__()
163
+ return self._ensure_context_var().__hash__()
170
164
 
171
165
 
172
166
  # we don't use the default factory here because `main_dg` is not initialized when this
@@ -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
 
@@ -42,7 +42,7 @@ from streamlit.elements.lib.column_config_utils import (
42
42
  )
43
43
  from streamlit.elements.lib.form_utils import current_form_id
44
44
  from streamlit.elements.lib.layout_utils import (
45
- HeightWithoutContent,
45
+ Height,
46
46
  LayoutConfig,
47
47
  Width,
48
48
  validate_height,
@@ -287,7 +287,7 @@ class ArrowMixin:
287
287
  self,
288
288
  data: Data = None,
289
289
  width: Width = "stretch",
290
- height: HeightWithoutContent | Literal["auto"] = "auto",
290
+ height: Height | Literal["auto"] = "auto",
291
291
  *,
292
292
  use_container_width: bool | None = None,
293
293
  hide_index: bool | None = None,
@@ -297,6 +297,7 @@ class ArrowMixin:
297
297
  on_select: Literal["ignore"] = "ignore",
298
298
  selection_mode: SelectionMode | Iterable[SelectionMode] = "multi-row",
299
299
  row_height: int | None = None,
300
+ placeholder: str | None = None,
300
301
  ) -> DeltaGenerator: ...
301
302
 
302
303
  @overload
@@ -304,7 +305,7 @@ class ArrowMixin:
304
305
  self,
305
306
  data: Data = None,
306
307
  width: Width = "stretch",
307
- height: HeightWithoutContent | Literal["auto"] = "auto",
308
+ height: Height | Literal["auto"] = "auto",
308
309
  *,
309
310
  use_container_width: bool | None = None,
310
311
  hide_index: bool | None = None,
@@ -314,6 +315,7 @@ class ArrowMixin:
314
315
  on_select: Literal["rerun"] | WidgetCallback,
315
316
  selection_mode: SelectionMode | Iterable[SelectionMode] = "multi-row",
316
317
  row_height: int | None = None,
318
+ placeholder: str | None = None,
317
319
  ) -> DataframeState: ...
318
320
 
319
321
  @gather_metrics("dataframe")
@@ -321,7 +323,7 @@ class ArrowMixin:
321
323
  self,
322
324
  data: Data = None,
323
325
  width: Width = "stretch",
324
- height: HeightWithoutContent | Literal["auto"] = "auto",
326
+ height: Height | Literal["auto"] = "auto",
325
327
  *,
326
328
  use_container_width: bool | None = None,
327
329
  hide_index: bool | None = None,
@@ -331,6 +333,7 @@ class ArrowMixin:
331
333
  on_select: Literal["ignore", "rerun"] | WidgetCallback = "ignore",
332
334
  selection_mode: SelectionMode | Iterable[SelectionMode] = "multi-row",
333
335
  row_height: int | None = None,
336
+ placeholder: str | None = None,
334
337
  ) -> DeltaGenerator | DataframeState:
335
338
  """Display a dataframe as an interactive table.
336
339
 
@@ -389,11 +392,14 @@ class ArrowMixin:
389
392
  the parent container, the width of the element matches the width
390
393
  of the parent container.
391
394
 
392
- height : "auto", "stretch", or int
395
+ height : "auto", "content", "stretch", or int
393
396
  The height of the dataframe element. This can be one of the following:
394
397
 
395
398
  - ``"auto"`` (default): Streamlit sets the height to show at most
396
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.
397
403
  - ``"stretch"``: The height of the element expands to fill the
398
404
  available vertical space in its parent container. When multiple
399
405
  elements with stretch height are in the same container, they
@@ -510,6 +516,12 @@ class ArrowMixin:
510
516
  is ``None`` (default), Streamlit will use a default row height,
511
517
  which fits one line of text.
512
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
+
513
525
  Returns
514
526
  -------
515
527
  element or dict
@@ -676,7 +688,7 @@ class ArrowMixin:
676
688
  validate_width(width, allow_content=True)
677
689
  validate_height(
678
690
  height,
679
- allow_content=False,
691
+ allow_content=True,
680
692
  additional_allowed=["auto"],
681
693
  )
682
694
 
@@ -691,6 +703,9 @@ class ArrowMixin:
691
703
  if column_order:
692
704
  proto.column_order[:] = column_order
693
705
 
706
+ if placeholder is not None:
707
+ proto.placeholder = placeholder
708
+
694
709
  proto.editing_mode = ArrowProto.EditingMode.READ_ONLY
695
710
 
696
711
  has_range_index: bool = False
@@ -767,6 +782,7 @@ class ArrowMixin:
767
782
  selection_mode=selection_mode,
768
783
  is_selection_activated=is_selection_activated,
769
784
  row_height=row_height,
785
+ placeholder=placeholder,
770
786
  )
771
787
 
772
788
  serde = DataframeSelectionSerde()
@@ -895,6 +911,12 @@ class ArrowMixin:
895
911
  def add_rows(self, data: Data = None, **kwargs: Any) -> DeltaGenerator | None:
896
912
  """Concatenate a dataframe to the bottom of the current one.
897
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
+
898
920
  Parameters
899
921
  ----------
900
922
  data : pandas.DataFrame, pandas.Styler, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.dataframe.DataFrame, Iterable, dict, or None
@@ -947,6 +969,14 @@ class ArrowMixin:
947
969
  >>> my_chart.add_rows(some_fancy_name=df2) # <-- name used as keyword
948
970
 
949
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
+
950
980
  return _arrow_add_rows(self.dg, data, **kwargs)
951
981
 
952
982
  @property
@@ -16,48 +16,33 @@
16
16
 
17
17
  from __future__ import annotations
18
18
 
19
- import json
20
- from typing import TYPE_CHECKING, Final, cast
19
+ from typing import TYPE_CHECKING, cast
21
20
 
22
21
  from streamlit.deprecation_util import (
23
22
  show_deprecation_warning,
24
23
  )
25
- from streamlit.errors import StreamlitAPIException
26
- from streamlit.proto.BokehChart_pb2 import BokehChart as BokehChartProto
27
24
  from streamlit.runtime.metrics_util import gather_metrics
28
- from streamlit.util import calc_md5
29
25
 
30
26
  if TYPE_CHECKING:
31
- from bokeh.plotting.figure import Figure
32
-
33
27
  from streamlit.delta_generator import DeltaGenerator
34
28
 
35
- ST_BOKEH_VERSION: Final = "2.4.3"
36
-
37
29
 
38
30
  class BokehMixin:
39
31
  @gather_metrics("bokeh_chart")
40
32
  def bokeh_chart(
41
33
  self,
42
- figure: Figure,
43
- use_container_width: bool = True,
34
+ figure: object, # noqa: ARG002
35
+ use_container_width: bool = True, # noqa: ARG002
44
36
  ) -> DeltaGenerator:
45
37
  """Display an interactive Bokeh chart.
46
38
 
47
- Bokeh is a charting library for Python. The arguments to this function
48
- closely follow the ones for Bokeh's ``show`` function. You can find
39
+ Bokeh is a charting library for Python. You can find
49
40
  more about Bokeh at https://bokeh.pydata.org.
50
41
 
51
- To show Bokeh charts in Streamlit, call ``st.bokeh_chart``
52
- wherever you would call Bokeh's ``show``.
53
-
54
42
  .. Important::
55
- You must install ``bokeh==2.4.3`` and ``numpy<2`` to use this
56
- command, which is deprecated and will be removed in a future
57
- version.
58
-
59
- For more current updates, use the |streamlit-bokeh|_ custom
60
- component instead.
43
+ This command has been deprecated and removed. Please use our custom
44
+ component, |streamlit-bokeh|_, instead. Calling st.bokeh_chart will
45
+ do nothing.
61
46
 
62
47
  .. |streamlit-bokeh| replace:: ``streamlit-bokeh``
63
48
  .. _streamlit-bokeh: https://github.com/streamlit/streamlit-bokeh
@@ -74,70 +59,17 @@ class BokehMixin:
74
59
  container. If ``use_container_width`` is ``False``, Streamlit sets the
75
60
  width of the chart to fit its contents according to the plotting library,
76
61
  up to the width of the parent container.
77
-
78
- Example
79
- -------
80
- >>> import streamlit as st
81
- >>> from bokeh.plotting import figure
82
- >>>
83
- >>> x = [1, 2, 3, 4, 5]
84
- >>> y = [6, 7, 2, 4, 5]
85
- >>>
86
- >>> p = figure(title="simple line example", x_axis_label="x", y_axis_label="y")
87
- >>> p.line(x, y, legend_label="Trend", line_width=2)
88
- >>>
89
- >>> st.bokeh_chart(p)
90
-
91
- .. output::
92
- https://doc-bokeh-chart.streamlit.app/
93
- height: 700px
94
-
95
62
  """
96
- import bokeh
97
-
98
- if bokeh.__version__ != ST_BOKEH_VERSION:
99
- raise StreamlitAPIException(
100
- f"Streamlit only supports Bokeh version {ST_BOKEH_VERSION}, "
101
- f"but you have version {bokeh.__version__} installed. Please "
102
- f"run `pip install --force-reinstall --no-deps bokeh=="
103
- f"{ST_BOKEH_VERSION}` to install the correct version.\n\n\n"
104
- f"To use the latest version of Bokeh, install our custom component, "
105
- f"[streamlit-bokeh](https://github.com/streamlit/streamlit-bokeh)."
106
- )
107
63
 
108
64
  show_deprecation_warning(
109
- "st.bokeh_chart is deprecated and will be removed in a future version. "
65
+ "st.bokeh_chart has been deprecated and removed. "
110
66
  "Please use our custom component, "
111
67
  "[streamlit-bokeh](https://github.com/streamlit/streamlit-bokeh), "
112
- "instead."
68
+ "instead. Calling st.bokeh_chart will do nothing."
113
69
  )
114
- # Generate element ID from delta path
115
- delta_path = self.dg._get_delta_path_str()
116
-
117
- element_id = calc_md5(delta_path.encode())
118
- bokeh_chart_proto = BokehChartProto()
119
- marshall(bokeh_chart_proto, figure, use_container_width, element_id)
120
- return self.dg._enqueue("bokeh_chart", bokeh_chart_proto)
70
+ return self.dg
121
71
 
122
72
  @property
123
73
  def dg(self) -> DeltaGenerator:
124
74
  """Get our DeltaGenerator."""
125
75
  return cast("DeltaGenerator", self)
126
-
127
-
128
- def marshall(
129
- proto: BokehChartProto,
130
- figure: Figure,
131
- use_container_width: bool,
132
- element_id: str,
133
- ) -> None:
134
- """Construct a Bokeh chart object.
135
-
136
- See DeltaGenerator.bokeh_chart for docs.
137
- """
138
- from bokeh.embed import json_item
139
-
140
- data = json_item(figure)
141
- proto.figure = json.dumps(data)
142
- proto.use_container_width = use_container_width
143
- proto.element_id = element_id
@@ -109,7 +109,7 @@ class CodeMixin:
109
109
  ... print("Hello, Streamlit!")'''
110
110
  >>> st.code(code, language="python")
111
111
 
112
- .. output ::
112
+ .. output::
113
113
  https://doc-code.streamlit.app/
114
114
  height: 220px
115
115
 
@@ -129,7 +129,7 @@ class CodeMixin:
129
129
  ... '''
130
130
  >>> st.code(code, language=None)
131
131
 
132
- .. output ::
132
+ .. output::
133
133
  https://doc-code-ascii.streamlit.app/
134
134
  height: 380px
135
135
  """
@@ -182,7 +182,7 @@ class PydeckSelectionState(TypedDict, total=False):
182
182
  >>>
183
183
  >>> event.selection
184
184
 
185
- .. output ::
185
+ .. output::
186
186
  https://doc-pydeck-event-state-selections.streamlit.app/
187
187
  height: 700px
188
188
 
@@ -79,7 +79,7 @@ class ExceptionMixin:
79
79
  >>> e = RuntimeError("This is an exception of type RuntimeError")
80
80
  >>> st.exception(e)
81
81
 
82
- .. output ::
82
+ .. output::
83
83
  https://doc-status-exception.streamlit.app/
84
84
  height: 220px
85
85
 
@@ -250,6 +250,7 @@ class FormMixin:
250
250
  disabled: bool = False,
251
251
  use_container_width: bool | None = None,
252
252
  width: Width = "content",
253
+ shortcut: str | None = None,
253
254
  ) -> bool:
254
255
  r"""Display a form submit button.
255
256
 
@@ -332,6 +333,8 @@ class FormMixin:
332
333
  <https://fonts.google.com/icons?icon.set=Material+Symbols&icon.style=Rounded>`_
333
334
  font library.
334
335
 
336
+ - ``"spinner"``: Displays a spinner as an icon.
337
+
335
338
  disabled : bool
336
339
  Whether to disable the button. If this is ``False`` (default), the
337
340
  user can interact with the button. If this is ``True``, the button
@@ -369,6 +372,27 @@ class FormMixin:
369
372
  the parent container, the width of the button matches the width
370
373
  of the parent container.
371
374
 
375
+ shortcut : str or None
376
+ An optional keyboard shortcut that triggers the button. This can be
377
+ one of the following strings:
378
+
379
+ - A single alphanumeric key like ``"K"`` or ``"4"``.
380
+ - A function key like ``"F11"``.
381
+ - A special key like ``"Enter"``, ``"Esc"``, or ``"Tab"``.
382
+ - Any of the above combined with modifiers. For example, you can use
383
+ ``"Ctrl+K"`` or ``"Cmd+Shift+O"``.
384
+
385
+ .. important::
386
+ The keys ``"C"`` and ``"R"`` are reserved and can't be used,
387
+ even with modifiers. Punctuation keys like ``"."`` and ``","``
388
+ aren't currently supported.
389
+
390
+ For a list of supported keys and modifiers, see the documentation
391
+ for |st.button|_.
392
+
393
+ .. |st.button| replace:: ``st.button``
394
+ .. _st.button: https://docs.streamlit.io/develop/api-reference/widgets/st.button
395
+
372
396
  Returns
373
397
  -------
374
398
  bool
@@ -398,6 +422,7 @@ class FormMixin:
398
422
  ctx=ctx,
399
423
  width=width,
400
424
  key=key,
425
+ shortcut=shortcut,
401
426
  )
402
427
 
403
428
  def _form_submit_button(
@@ -414,6 +439,7 @@ class FormMixin:
414
439
  disabled: bool = False,
415
440
  ctx: ScriptRunContext | None = None,
416
441
  width: Width = "content",
442
+ shortcut: str | None = None,
417
443
  ) -> bool:
418
444
  form_id = current_form_id(self.dg)
419
445
  submit_button_key = to_key(key) or f"FormSubmitter:{form_id}-{label}"
@@ -430,6 +456,7 @@ class FormMixin:
430
456
  disabled=disabled,
431
457
  ctx=ctx,
432
458
  width=width,
459
+ shortcut=shortcut,
433
460
  )
434
461
 
435
462
  @property