streamlit 1.47.1__py3-none-any.whl → 1.48.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.
Files changed (189) hide show
  1. streamlit/cli_util.py +1 -1
  2. streamlit/commands/echo.py +2 -2
  3. streamlit/commands/execution_control.py +1 -1
  4. streamlit/commands/page_config.py +16 -16
  5. streamlit/components/v1/component_arrow.py +4 -4
  6. streamlit/config.py +23 -5
  7. streamlit/connections/base_connection.py +2 -2
  8. streamlit/connections/snowflake_connection.py +2 -2
  9. streamlit/connections/sql_connection.py +4 -3
  10. streamlit/dataframe_util.py +1 -1
  11. streamlit/deprecation_util.py +20 -5
  12. streamlit/elements/arrow.py +105 -79
  13. streamlit/elements/deck_gl_json_chart.py +6 -6
  14. streamlit/elements/dialog_decorator.py +72 -17
  15. streamlit/elements/form.py +36 -7
  16. streamlit/elements/graphviz_chart.py +7 -0
  17. streamlit/elements/json.py +3 -3
  18. streamlit/elements/layouts.py +241 -75
  19. streamlit/elements/lib/built_in_chart_utils.py +11 -3
  20. streamlit/elements/lib/dialog.py +43 -0
  21. streamlit/elements/lib/file_uploader_utils.py +21 -2
  22. streamlit/elements/lib/layout_utils.py +88 -2
  23. streamlit/elements/lib/options_selector_utils.py +1 -1
  24. streamlit/elements/lib/utils.py +23 -3
  25. streamlit/elements/map.py +12 -11
  26. streamlit/elements/plotly_chart.py +21 -21
  27. streamlit/elements/pyplot.py +8 -4
  28. streamlit/elements/vega_charts.py +237 -143
  29. streamlit/elements/widgets/audio_input.py +2 -2
  30. streamlit/elements/widgets/button.py +147 -35
  31. streamlit/elements/widgets/button_group.py +9 -8
  32. streamlit/elements/widgets/camera_input.py +2 -2
  33. streamlit/elements/widgets/chat.py +8 -2
  34. streamlit/elements/widgets/checkbox.py +4 -4
  35. streamlit/elements/widgets/color_picker.py +2 -2
  36. streamlit/elements/widgets/data_editor.py +22 -15
  37. streamlit/elements/widgets/file_uploader.py +8 -2
  38. streamlit/elements/widgets/multiselect.py +27 -17
  39. streamlit/elements/widgets/number_input.py +2 -2
  40. streamlit/elements/widgets/radio.py +5 -4
  41. streamlit/elements/widgets/select_slider.py +8 -5
  42. streamlit/elements/widgets/selectbox.py +14 -4
  43. streamlit/elements/widgets/slider.py +59 -33
  44. streamlit/elements/widgets/text_widgets.py +4 -4
  45. streamlit/elements/widgets/time_widgets.py +4 -4
  46. streamlit/elements/write.py +9 -8
  47. streamlit/env_util.py +1 -1
  48. streamlit/errors.py +20 -4
  49. streamlit/file_util.py +1 -1
  50. streamlit/git_util.py +1 -1
  51. streamlit/logger.py +2 -2
  52. streamlit/proto/Block_pb2.py +39 -31
  53. streamlit/proto/Block_pb2.pyi +54 -3
  54. streamlit/proto/Button_pb2.py +4 -2
  55. streamlit/proto/Button_pb2.pyi +1 -0
  56. streamlit/runtime/caching/cache_data_api.py +15 -2
  57. streamlit/runtime/caching/cache_errors.py +1 -1
  58. streamlit/runtime/caching/cache_resource_api.py +24 -2
  59. streamlit/runtime/caching/cache_utils.py +6 -3
  60. streamlit/runtime/caching/hashing.py +6 -9
  61. streamlit/runtime/fragment.py +3 -2
  62. streamlit/runtime/runtime.py +19 -2
  63. streamlit/runtime/scriptrunner/script_runner.py +3 -3
  64. streamlit/runtime/state/common.py +2 -1
  65. streamlit/runtime/state/query_params.py +2 -1
  66. streamlit/runtime/state/session_state.py +1 -1
  67. streamlit/static/index.html +1 -1
  68. streamlit/static/manifest.json +231 -231
  69. streamlit/static/static/css/index.CQt5TjGB.css +1 -0
  70. streamlit/static/static/js/{ErrorOutline.esm.BEZPMjuG.js → ErrorOutline.esm.D_4oFNKB.js} +1 -1
  71. streamlit/static/static/js/{FileDownload.esm.Dy1V9a2E.js → FileDownload.esm.NPgaLlUE.js} +1 -1
  72. streamlit/static/static/js/{FileHelper.D0K06YBq.js → FileHelper.B2t9ikoS.js} +1 -1
  73. streamlit/static/static/js/{FormClearHelper.Cdw5Y7_m.js → FormClearHelper.BLEIUk6L.js} +1 -1
  74. streamlit/static/static/js/{Hooks.C_qx1sSw.js → Hooks.BGm9sd4U.js} +1 -1
  75. streamlit/static/static/js/{InputInstructions.D3IDU-eY.js → InputInstructions.DtUxCBS8.js} +1 -1
  76. streamlit/static/static/js/Particles.BDRPO7r3.js +1 -0
  77. streamlit/static/static/js/ProgressBar.B64DUUqp.js +2 -0
  78. streamlit/static/static/js/Toolbar.B3FquPk5.js +1 -0
  79. streamlit/static/static/js/{base-input.DMlw5p7n.js → base-input.DeBqm5mN.js} +4 -4
  80. streamlit/static/static/js/{checkbox.C7QR6llE.js → checkbox.C0odQfKb.js} +2 -2
  81. streamlit/static/static/js/createDownloadLinkElement.ZaXNnPK4.js +1 -0
  82. streamlit/static/static/js/{createSuper.C5k_2vfB.js → createSuper.DqQ5L3XG.js} +1 -1
  83. streamlit/static/static/js/data-grid-overlay-editor.DbNsQa8Y.js +1 -0
  84. streamlit/static/static/js/{downloader.Nj6v3ioB.js → downloader.Bx1D0jhz.js} +1 -1
  85. streamlit/static/static/js/{es6.CVz13CSz.js → es6.CbPK4m0H.js} +2 -2
  86. streamlit/static/static/js/{iframeResizer.contentWindow.gZ8zjT0K.js → iframeResizer.contentWindow.CfLKrptA.js} +1 -1
  87. streamlit/static/static/js/{index.D3wOJJsg.js → index.0XDwe9RV.js} +12 -12
  88. streamlit/static/static/js/{index.BscWuWHL.js → index.4lI9TuZm.js} +3 -3
  89. streamlit/static/static/js/index.6s0nVIis.js +3855 -0
  90. streamlit/static/static/js/index.9E7bRUBU.js +1 -0
  91. streamlit/static/static/js/index.B9PgeLrZ.js +1 -0
  92. streamlit/static/static/js/index.B9vzGbOt.js +1 -0
  93. streamlit/static/static/js/index.BDrQKMCm.js +1 -0
  94. streamlit/static/static/js/index.BPsoiGgP.js +1 -0
  95. streamlit/static/static/js/index.CJzdLAun.js +1 -0
  96. streamlit/static/static/js/index.CNNlC1NL.js +1 -0
  97. streamlit/static/static/js/index.CO1sClzJ.js +2 -0
  98. streamlit/static/static/js/index.CZnagxXD.js +1 -0
  99. streamlit/static/static/js/{index.MbqsiUV4.js → index.Cb0xSF7V.js} +289 -289
  100. streamlit/static/static/js/index.CgUt3tz_.js +1 -0
  101. streamlit/static/static/js/index.CjImmcsV.js +1 -0
  102. streamlit/static/static/js/index.ClRTsv8m.js +2 -0
  103. streamlit/static/static/js/{index.CTT2YqEU.js → index.CnfWsQzS.js} +1 -1
  104. streamlit/static/static/js/index.CrJ1XD_V.js +1 -0
  105. streamlit/static/static/js/index.CtiKsjSC.js +1 -0
  106. streamlit/static/static/js/index.CwAuytgV.js +1 -0
  107. streamlit/static/static/js/index.D7GB-kly.js +1 -0
  108. streamlit/static/static/js/index.DA5wU0mQ.js +1 -0
  109. streamlit/static/static/js/{index.xfcNJBLM.js → index.DCpyIFTV.js} +1 -1
  110. streamlit/static/static/js/index.DE9wNOje.js +1 -0
  111. streamlit/static/static/js/{index.mihWZKb1.js → index.DHnB-C8A.js} +1 -1
  112. streamlit/static/static/js/{index.BSFzxMXi.js → index.DRTn9zvD.js} +1 -1
  113. streamlit/static/static/js/index.DjMjyJl9.js +7 -0
  114. streamlit/static/static/js/{index.CbQtRkVt.js → index.DvRPFfw6.js} +162 -188
  115. streamlit/static/static/js/{index.B2L574n6.js → index.DwaoC4Zp.js} +3 -3
  116. streamlit/static/static/js/index.F9tSej94.js +1 -0
  117. streamlit/static/static/js/index.HeVbRh9H.js +73 -0
  118. streamlit/static/static/js/index.J2D_m7LY.js +197 -0
  119. streamlit/static/static/js/index.PyIqRRSR.js +1 -0
  120. streamlit/static/static/js/index.dfivzJNz.js +1 -0
  121. streamlit/static/static/js/index.mRztGO69.js +3 -0
  122. streamlit/static/static/js/index.tB1kn_7z.js +1 -0
  123. streamlit/static/static/js/index.wDYef4mQ.js +12 -0
  124. streamlit/static/static/js/{input.D_45B0P-.js → input.BL2buuce.js} +2 -2
  125. streamlit/static/static/js/{memory.BmhrRyO2.js → memory.CUxjUWS7.js} +1 -1
  126. streamlit/static/static/js/{mergeWith.DvOME7eH.js → mergeWith.C1kp1zIi.js} +1 -1
  127. streamlit/static/static/js/{number-overlay-editor.BRNxOzEZ.js → number-overlay-editor.WpheGpmR.js} +1 -1
  128. streamlit/static/static/js/{possibleConstructorReturn.C5GiK_Ob.js → possibleConstructorReturn.DbvQboK3.js} +1 -1
  129. streamlit/static/static/js/{sandbox.B-Q9S7vW.js → sandbox.6lnFVWhX.js} +1 -1
  130. streamlit/static/static/js/{timepicker.DOMbfm_a.js → timepicker.Bg4xAK95.js} +1 -1
  131. streamlit/static/static/js/{toConsumableArray.CbNz0Ciu.js → toConsumableArray.D9x7Ktv4.js} +1 -1
  132. streamlit/static/static/js/{uniqueId.-ygIU7IL.js → uniqueId.Bm8FHN92.js} +1 -1
  133. streamlit/static/static/js/{useBasicWidgetState.Bx3VaRHk.js → useBasicWidgetState.CUSYQZpm.js} +1 -1
  134. streamlit/static/static/js/{useTextInputAutoExpand.BuE9l5TG.js → useTextInputAutoExpand.Bf2egQOG.js} +2 -2
  135. streamlit/static/static/js/useUpdateUiValue.lE5xnYWF.js +1 -0
  136. streamlit/static/static/js/withFullScreenWrapper.CCOXR7N6.js +1 -0
  137. streamlit/temporary_directory.py +5 -3
  138. streamlit/testing/v1/app_test.py +4 -1
  139. streamlit/testing/v1/element_tree.py +4 -5
  140. streamlit/type_util.py +10 -3
  141. streamlit/user_info.py +18 -14
  142. streamlit/util.py +11 -1
  143. streamlit/watcher/local_sources_watcher.py +4 -3
  144. streamlit/web/bootstrap.py +18 -12
  145. streamlit/web/cli.py +2 -1
  146. streamlit/web/server/oauth_authlib_routes.py +59 -3
  147. streamlit/web/server/server.py +72 -21
  148. {streamlit-1.47.1.dist-info → streamlit-1.48.0.dist-info}/METADATA +14 -2
  149. {streamlit-1.47.1.dist-info → streamlit-1.48.0.dist-info}/RECORD +153 -153
  150. streamlit/static/static/css/index.CsLB_Bnz.css +0 -1
  151. streamlit/static/static/js/ProgressBar.EhJ_lCOf.js +0 -2
  152. streamlit/static/static/js/RenderInPortalIfExists.D6a0mMll.js +0 -1
  153. streamlit/static/static/js/Toolbar.D6yqQ65-.js +0 -1
  154. streamlit/static/static/js/createDownloadLinkElement.DZMwyjvU.js +0 -1
  155. streamlit/static/static/js/data-grid-overlay-editor.CoquyZNK.js +0 -1
  156. streamlit/static/static/js/index.B3n-pURl.js +0 -2
  157. streamlit/static/static/js/index.B9jJp9aE.js +0 -1
  158. streamlit/static/static/js/index.BBVtld-D.js +0 -1
  159. streamlit/static/static/js/index.BKHPnvYd.js +0 -1
  160. streamlit/static/static/js/index.B_1CXynz.js +0 -1
  161. streamlit/static/static/js/index.Bm1LklYO.js +0 -1
  162. streamlit/static/static/js/index.Byi6__iF.js +0 -1
  163. streamlit/static/static/js/index.BzJeMpQ-.js +0 -197
  164. streamlit/static/static/js/index.C4tw7-Cl.js +0 -2
  165. streamlit/static/static/js/index.CG0C49ex.js +0 -1
  166. streamlit/static/static/js/index.CMuSJPv-.js +0 -1
  167. streamlit/static/static/js/index.COPFcr_K.js +0 -3855
  168. streamlit/static/static/js/index.CU3TLDlu.js +0 -1
  169. streamlit/static/static/js/index.CVKKDwaf.js +0 -1
  170. streamlit/static/static/js/index.CWZeK3mV.js +0 -12
  171. streamlit/static/static/js/index.CWbiNJQl.js +0 -1
  172. streamlit/static/static/js/index.CWxefYP6.js +0 -73
  173. streamlit/static/static/js/index.DOdWa88b.js +0 -1
  174. streamlit/static/static/js/index.DXtnaPua.js +0 -1
  175. streamlit/static/static/js/index.DatDwFl3.js +0 -3
  176. streamlit/static/static/js/index.DeWYPvQR.js +0 -1
  177. streamlit/static/static/js/index.Do4vzIvK.js +0 -1
  178. streamlit/static/static/js/index.Dvrstlh8.js +0 -1
  179. streamlit/static/static/js/index.DvznfdF_.js +0 -1
  180. streamlit/static/static/js/index.U1vvXeGn.js +0 -1
  181. streamlit/static/static/js/index._WAuWRkp.js +0 -7
  182. streamlit/static/static/js/index.bwA9_eWC.js +0 -1
  183. streamlit/static/static/js/index.m1njXuKl.js +0 -1
  184. streamlit/static/static/js/useOnInputChange.CDZx-L6q.js +0 -1
  185. streamlit/static/static/js/withFullScreenWrapper.DWXejOhQ.js +0 -1
  186. {streamlit-1.47.1.data → streamlit-1.48.0.data}/scripts/streamlit.cmd +0 -0
  187. {streamlit-1.47.1.dist-info → streamlit-1.48.0.dist-info}/WHEEL +0 -0
  188. {streamlit-1.47.1.dist-info → streamlit-1.48.0.dist-info}/entry_points.txt +0 -0
  189. {streamlit-1.47.1.dist-info → streamlit-1.48.0.dist-info}/top_level.txt +0 -0
@@ -17,7 +17,7 @@ from streamlit.proto import HeightConfig_pb2 as streamlit_dot_proto_dot_HeightCo
17
17
  from streamlit.proto import GapSize_pb2 as streamlit_dot_proto_dot_GapSize__pb2
18
18
 
19
19
 
20
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Block.proto\x1a!streamlit/proto/WidthConfig.proto\x1a\"streamlit/proto/HeightConfig.proto\x1a\x1dstreamlit/proto/GapSize.proto\"\xe3\r\n\x05\x42lock\x12#\n\x08vertical\x18\x01 \x01(\x0b\x32\x0f.Block.VerticalH\x00\x12\'\n\nhorizontal\x18\x02 \x01(\x0b\x32\x11.Block.HorizontalH\x00\x12\x1f\n\x06\x63olumn\x18\x03 \x01(\x0b\x32\r.Block.ColumnH\x00\x12\'\n\nexpandable\x18\x04 \x01(\x0b\x32\x11.Block.ExpandableH\x00\x12\x1b\n\x04\x66orm\x18\x05 \x01(\x0b\x32\x0b.Block.FormH\x00\x12,\n\rtab_container\x18\x06 \x01(\x0b\x32\x13.Block.TabContainerH\x00\x12\x19\n\x03tab\x18\x07 \x01(\x0b\x32\n.Block.TabH\x00\x12*\n\x0c\x63hat_message\x18\t \x01(\x0b\x32\x12.Block.ChatMessageH\x00\x12!\n\x07popover\x18\n \x01(\x0b\x32\x0e.Block.PopoverH\x00\x12\x1f\n\x06\x64ialog\x18\x0b \x01(\x0b\x32\r.Block.DialogH\x00\x12.\n\x0e\x66lex_container\x18\r \x01(\x0b\x32\x14.Block.FlexContainerH\x00\x12\x13\n\x0b\x61llow_empty\x18\x08 \x01(\x08\x12\x0f\n\x02id\x18\x0c \x01(\tH\x01\x88\x01\x01\x12\x33\n\rheight_config\x18\x0e \x01(\x0b\x32\x17.streamlit.HeightConfigH\x02\x88\x01\x01\x12\x31\n\x0cwidth_config\x18\x0f \x01(\x0b\x32\x16.streamlit.WidthConfigH\x03\x88\x01\x01\x1a*\n\x08Vertical\x12\x0e\n\x06\x62order\x18\x01 \x01(\x08\x12\x0e\n\x06height\x18\x02 \x01(\r\x1a\x19\n\nHorizontal\x12\x0b\n\x03gap\x18\x01 \x01(\t\x1a\xdd\x01\n\rFlexContainer\x12\x0e\n\x06\x62order\x18\x01 \x01(\x08\x12(\n\ngap_config\x18\x02 \x01(\x0b\x32\x14.streamlit.GapConfig\x12\r\n\x05scale\x18\x03 \x01(\x02\x12\x31\n\tdirection\x18\x04 \x01(\x0e\x32\x1e.Block.FlexContainer.Direction\x12\x0c\n\x04wrap\x18\x05 \x01(\x08\"B\n\tDirection\x12\x17\n\x13\x44IRECTION_UNDEFINED\x10\x00\x12\x0c\n\x08VERTICAL\x10\x01\x12\x0e\n\nHORIZONTAL\x10\x02\x1a\xef\x01\n\x06\x43olumn\x12\x0e\n\x06weight\x18\x01 \x01(\x01\x12\x0f\n\x03gap\x18\x02 \x01(\tB\x02\x18\x01\x12;\n\x12vertical_alignment\x18\x03 \x01(\x0e\x32\x1f.Block.Column.VerticalAlignment\x12\x13\n\x0bshow_border\x18\x04 \x01(\x08\x12-\n\ngap_config\x18\x05 \x01(\x0b\x32\x14.streamlit.GapConfigH\x00\x88\x01\x01\"4\n\x11VerticalAlignment\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x43\x45NTER\x10\x01\x12\n\n\x06\x42OTTOM\x10\x02\x42\r\n\x0b_gap_config\x1aM\n\nExpandable\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\x08\x65xpanded\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04icon\x18\x03 \x01(\tB\x0b\n\t_expanded\x1a\x9d\x01\n\x06\x44ialog\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64ismissible\x18\x02 \x01(\x08\x12(\n\x05width\x18\x03 \x01(\x0e\x32\x19.Block.Dialog.DialogWidth\x12\x14\n\x07is_open\x18\x04 \x01(\x08H\x00\x88\x01\x01\"#\n\x0b\x44ialogWidth\x12\t\n\x05SMALL\x10\x00\x12\t\n\x05LARGE\x10\x01\x42\n\n\x08_is_open\x1aY\n\x04\x46orm\x12\x0f\n\x07\x66orm_id\x18\x01 \x01(\t\x12\x17\n\x0f\x63lear_on_submit\x18\x02 \x01(\x08\x12\x0e\n\x06\x62order\x18\x03 \x01(\x08\x12\x17\n\x0f\x65nter_to_submit\x18\x04 \x01(\x08\x1a\x0e\n\x0cTabContainer\x1a\x14\n\x03Tab\x12\r\n\x05label\x18\x01 \x01(\t\x1a\x63\n\x07Popover\x12\r\n\x05label\x18\x01 \x01(\t\x12\x1b\n\x13use_container_width\x18\x02 \x01(\x08\x12\x0c\n\x04help\x18\x03 \x01(\t\x12\x10\n\x08\x64isabled\x18\x04 \x01(\x08\x12\x0c\n\x04icon\x18\x05 \x01(\t\x1a\x8d\x01\n\x0b\x43hatMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x61vatar\x18\x02 \x01(\t\x12\x32\n\x0b\x61vatar_type\x18\x03 \x01(\x0e\x32\x1d.Block.ChatMessage.AvatarType\",\n\nAvatarType\x12\t\n\x05IMAGE\x10\x00\x12\t\n\x05\x45MOJI\x10\x01\x12\x08\n\x04ICON\x10\x02\x42\x06\n\x04typeB\x05\n\x03_idB\x10\n\x0e_height_configB\x0f\n\r_width_configB*\n\x1c\x63om.snowflake.apps.streamlitB\nBlockProtob\x06proto3')
20
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Block.proto\x1a!streamlit/proto/WidthConfig.proto\x1a\"streamlit/proto/HeightConfig.proto\x1a\x1dstreamlit/proto/GapSize.proto\"\x9b\x10\n\x05\x42lock\x12#\n\x08vertical\x18\x01 \x01(\x0b\x32\x0f.Block.VerticalH\x00\x12\'\n\nhorizontal\x18\x02 \x01(\x0b\x32\x11.Block.HorizontalH\x00\x12\x1f\n\x06\x63olumn\x18\x03 \x01(\x0b\x32\r.Block.ColumnH\x00\x12\'\n\nexpandable\x18\x04 \x01(\x0b\x32\x11.Block.ExpandableH\x00\x12\x1b\n\x04\x66orm\x18\x05 \x01(\x0b\x32\x0b.Block.FormH\x00\x12,\n\rtab_container\x18\x06 \x01(\x0b\x32\x13.Block.TabContainerH\x00\x12\x19\n\x03tab\x18\x07 \x01(\x0b\x32\n.Block.TabH\x00\x12*\n\x0c\x63hat_message\x18\t \x01(\x0b\x32\x12.Block.ChatMessageH\x00\x12!\n\x07popover\x18\n \x01(\x0b\x32\x0e.Block.PopoverH\x00\x12\x1f\n\x06\x64ialog\x18\x0b \x01(\x0b\x32\r.Block.DialogH\x00\x12.\n\x0e\x66lex_container\x18\r \x01(\x0b\x32\x14.Block.FlexContainerH\x00\x12\x13\n\x0b\x61llow_empty\x18\x08 \x01(\x08\x12\x0f\n\x02id\x18\x0c \x01(\tH\x01\x88\x01\x01\x12\x33\n\rheight_config\x18\x0e \x01(\x0b\x32\x17.streamlit.HeightConfigH\x02\x88\x01\x01\x12\x31\n\x0cwidth_config\x18\x0f \x01(\x0b\x32\x16.streamlit.WidthConfigH\x03\x88\x01\x01\x1a.\n\x08Vertical\x12\x0e\n\x06\x62order\x18\x01 \x01(\x08\x12\x12\n\x06height\x18\x02 \x01(\rB\x02\x18\x01\x1a\x19\n\nHorizontal\x12\x0b\n\x03gap\x18\x01 \x01(\t\x1a\x81\x04\n\rFlexContainer\x12\x0e\n\x06\x62order\x18\x01 \x01(\x08\x12(\n\ngap_config\x18\x02 \x01(\x0b\x32\x14.streamlit.GapConfig\x12\r\n\x05scale\x18\x03 \x01(\x02\x12\x31\n\tdirection\x18\x04 \x01(\x0e\x32\x1e.Block.FlexContainer.Direction\x12\x0c\n\x04wrap\x18\x05 \x01(\x08\x12-\n\x07justify\x18\x07 \x01(\x0e\x32\x1c.Block.FlexContainer.Justify\x12)\n\x05\x61lign\x18\x08 \x01(\x0e\x32\x1a.Block.FlexContainer.Align\"B\n\tDirection\x12\x17\n\x13\x44IRECTION_UNDEFINED\x10\x00\x12\x0c\n\x08VERTICAL\x10\x01\x12\x0e\n\nHORIZONTAL\x10\x02\"k\n\x07Justify\x12\x15\n\x11JUSTIFY_UNDEFINED\x10\x00\x12\x11\n\rJUSTIFY_START\x10\x01\x12\x0f\n\x0bJUSTIFY_END\x10\x02\x12\x12\n\x0eJUSTIFY_CENTER\x10\x03\x12\x11\n\rSPACE_BETWEEN\x10\x04\"[\n\x05\x41lign\x12\x13\n\x0f\x41LIGN_UNDEFINED\x10\x00\x12\x0f\n\x0b\x41LIGN_START\x10\x01\x12\r\n\tALIGN_END\x10\x02\x12\x10\n\x0c\x41LIGN_CENTER\x10\x03\x12\x0b\n\x07STRETCH\x10\x04\x1a\xef\x01\n\x06\x43olumn\x12\x0e\n\x06weight\x18\x01 \x01(\x01\x12\x0f\n\x03gap\x18\x02 \x01(\tB\x02\x18\x01\x12;\n\x12vertical_alignment\x18\x03 \x01(\x0e\x32\x1f.Block.Column.VerticalAlignment\x12\x13\n\x0bshow_border\x18\x04 \x01(\x08\x12-\n\ngap_config\x18\x05 \x01(\x0b\x32\x14.streamlit.GapConfigH\x00\x88\x01\x01\"4\n\x11VerticalAlignment\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x43\x45NTER\x10\x01\x12\n\n\x06\x42OTTOM\x10\x02\x42\r\n\x0b_gap_config\x1aM\n\nExpandable\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\x08\x65xpanded\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04icon\x18\x03 \x01(\tB\x0b\n\t_expanded\x1a\xa9\x01\n\x06\x44ialog\x12\r\n\x05title\x18\x01 \x01(\t\x12\x13\n\x0b\x64ismissible\x18\x02 \x01(\x08\x12(\n\x05width\x18\x03 \x01(\x0e\x32\x19.Block.Dialog.DialogWidth\x12\x14\n\x07is_open\x18\x04 \x01(\x08H\x00\x88\x01\x01\x12\n\n\x02id\x18\x05 \x01(\t\"#\n\x0b\x44ialogWidth\x12\t\n\x05SMALL\x10\x00\x12\t\n\x05LARGE\x10\x01\x42\n\n\x08_is_open\x1aY\n\x04\x46orm\x12\x0f\n\x07\x66orm_id\x18\x01 \x01(\t\x12\x17\n\x0f\x63lear_on_submit\x18\x02 \x01(\x08\x12\x0e\n\x06\x62order\x18\x03 \x01(\x08\x12\x17\n\x0f\x65nter_to_submit\x18\x04 \x01(\x08\x1a\x0e\n\x0cTabContainer\x1a\x14\n\x03Tab\x12\r\n\x05label\x18\x01 \x01(\t\x1ag\n\x07Popover\x12\r\n\x05label\x18\x01 \x01(\t\x12\x1f\n\x13use_container_width\x18\x02 \x01(\x08\x42\x02\x18\x01\x12\x0c\n\x04help\x18\x03 \x01(\t\x12\x10\n\x08\x64isabled\x18\x04 \x01(\x08\x12\x0c\n\x04icon\x18\x05 \x01(\t\x1a\x8d\x01\n\x0b\x43hatMessage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0e\n\x06\x61vatar\x18\x02 \x01(\t\x12\x32\n\x0b\x61vatar_type\x18\x03 \x01(\x0e\x32\x1d.Block.ChatMessage.AvatarType\",\n\nAvatarType\x12\t\n\x05IMAGE\x10\x00\x12\t\n\x05\x45MOJI\x10\x01\x12\x08\n\x04ICON\x10\x02\x42\x06\n\x04typeB\x05\n\x03_idB\x10\n\x0e_height_configB\x0f\n\r_width_configB*\n\x1c\x63om.snowflake.apps.streamlitB\nBlockProtob\x06proto3')
21
21
 
22
22
  _globals = globals()
23
23
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -25,38 +25,46 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Block_pb2',
25
25
  if not _descriptor._USE_C_DESCRIPTORS:
26
26
  _globals['DESCRIPTOR']._loaded_options = None
27
27
  _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\nBlockProto'
28
+ _globals['_BLOCK_VERTICAL'].fields_by_name['height']._loaded_options = None
29
+ _globals['_BLOCK_VERTICAL'].fields_by_name['height']._serialized_options = b'\030\001'
28
30
  _globals['_BLOCK_COLUMN'].fields_by_name['gap']._loaded_options = None
29
31
  _globals['_BLOCK_COLUMN'].fields_by_name['gap']._serialized_options = b'\030\001'
32
+ _globals['_BLOCK_POPOVER'].fields_by_name['use_container_width']._loaded_options = None
33
+ _globals['_BLOCK_POPOVER'].fields_by_name['use_container_width']._serialized_options = b'\030\001'
30
34
  _globals['_BLOCK']._serialized_start=134
31
- _globals['_BLOCK']._serialized_end=1897
35
+ _globals['_BLOCK']._serialized_end=2209
32
36
  _globals['_BLOCK_VERTICAL']._serialized_start=699
33
- _globals['_BLOCK_VERTICAL']._serialized_end=741
34
- _globals['_BLOCK_HORIZONTAL']._serialized_start=743
35
- _globals['_BLOCK_HORIZONTAL']._serialized_end=768
36
- _globals['_BLOCK_FLEXCONTAINER']._serialized_start=771
37
- _globals['_BLOCK_FLEXCONTAINER']._serialized_end=992
38
- _globals['_BLOCK_FLEXCONTAINER_DIRECTION']._serialized_start=926
39
- _globals['_BLOCK_FLEXCONTAINER_DIRECTION']._serialized_end=992
40
- _globals['_BLOCK_COLUMN']._serialized_start=995
41
- _globals['_BLOCK_COLUMN']._serialized_end=1234
42
- _globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_start=1167
43
- _globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_end=1219
44
- _globals['_BLOCK_EXPANDABLE']._serialized_start=1236
45
- _globals['_BLOCK_EXPANDABLE']._serialized_end=1313
46
- _globals['_BLOCK_DIALOG']._serialized_start=1316
47
- _globals['_BLOCK_DIALOG']._serialized_end=1473
48
- _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_start=1426
49
- _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_end=1461
50
- _globals['_BLOCK_FORM']._serialized_start=1475
51
- _globals['_BLOCK_FORM']._serialized_end=1564
52
- _globals['_BLOCK_TABCONTAINER']._serialized_start=1566
53
- _globals['_BLOCK_TABCONTAINER']._serialized_end=1580
54
- _globals['_BLOCK_TAB']._serialized_start=1582
55
- _globals['_BLOCK_TAB']._serialized_end=1602
56
- _globals['_BLOCK_POPOVER']._serialized_start=1604
57
- _globals['_BLOCK_POPOVER']._serialized_end=1703
58
- _globals['_BLOCK_CHATMESSAGE']._serialized_start=1706
59
- _globals['_BLOCK_CHATMESSAGE']._serialized_end=1847
60
- _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_start=1803
61
- _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_end=1847
37
+ _globals['_BLOCK_VERTICAL']._serialized_end=745
38
+ _globals['_BLOCK_HORIZONTAL']._serialized_start=747
39
+ _globals['_BLOCK_HORIZONTAL']._serialized_end=772
40
+ _globals['_BLOCK_FLEXCONTAINER']._serialized_start=775
41
+ _globals['_BLOCK_FLEXCONTAINER']._serialized_end=1288
42
+ _globals['_BLOCK_FLEXCONTAINER_DIRECTION']._serialized_start=1020
43
+ _globals['_BLOCK_FLEXCONTAINER_DIRECTION']._serialized_end=1086
44
+ _globals['_BLOCK_FLEXCONTAINER_JUSTIFY']._serialized_start=1088
45
+ _globals['_BLOCK_FLEXCONTAINER_JUSTIFY']._serialized_end=1195
46
+ _globals['_BLOCK_FLEXCONTAINER_ALIGN']._serialized_start=1197
47
+ _globals['_BLOCK_FLEXCONTAINER_ALIGN']._serialized_end=1288
48
+ _globals['_BLOCK_COLUMN']._serialized_start=1291
49
+ _globals['_BLOCK_COLUMN']._serialized_end=1530
50
+ _globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_start=1463
51
+ _globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_end=1515
52
+ _globals['_BLOCK_EXPANDABLE']._serialized_start=1532
53
+ _globals['_BLOCK_EXPANDABLE']._serialized_end=1609
54
+ _globals['_BLOCK_DIALOG']._serialized_start=1612
55
+ _globals['_BLOCK_DIALOG']._serialized_end=1781
56
+ _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_start=1734
57
+ _globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_end=1769
58
+ _globals['_BLOCK_FORM']._serialized_start=1783
59
+ _globals['_BLOCK_FORM']._serialized_end=1872
60
+ _globals['_BLOCK_TABCONTAINER']._serialized_start=1874
61
+ _globals['_BLOCK_TABCONTAINER']._serialized_end=1888
62
+ _globals['_BLOCK_TAB']._serialized_start=1890
63
+ _globals['_BLOCK_TAB']._serialized_end=1910
64
+ _globals['_BLOCK_POPOVER']._serialized_start=1912
65
+ _globals['_BLOCK_POPOVER']._serialized_end=2015
66
+ _globals['_BLOCK_CHATMESSAGE']._serialized_start=2018
67
+ _globals['_BLOCK_CHATMESSAGE']._serialized_end=2159
68
+ _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_start=2115
69
+ _globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_end=2159
62
70
  # @@protoc_insertion_point(module_scope)
@@ -46,7 +46,9 @@ class Block(google.protobuf.message.Message):
46
46
  HEIGHT_FIELD_NUMBER: builtins.int
47
47
  border: builtins.bool
48
48
  height: builtins.int
49
- """Height of the container, activates scrolling"""
49
+ """DEPRECATED: We use height_config on the top-level which is shared.
50
+ with other Block types.
51
+ """
50
52
  def __init__(
51
53
  self,
52
54
  *,
@@ -87,15 +89,57 @@ class Block(google.protobuf.message.Message):
87
89
  VERTICAL: Block.FlexContainer.Direction.ValueType # 1
88
90
  HORIZONTAL: Block.FlexContainer.Direction.ValueType # 2
89
91
 
92
+ class _Justify:
93
+ ValueType = typing.NewType("ValueType", builtins.int)
94
+ V: typing_extensions.TypeAlias = ValueType
95
+
96
+ class _JustifyEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Block.FlexContainer._Justify.ValueType], builtins.type):
97
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
98
+ JUSTIFY_UNDEFINED: Block.FlexContainer._Justify.ValueType # 0
99
+ JUSTIFY_START: Block.FlexContainer._Justify.ValueType # 1
100
+ JUSTIFY_END: Block.FlexContainer._Justify.ValueType # 2
101
+ JUSTIFY_CENTER: Block.FlexContainer._Justify.ValueType # 3
102
+ SPACE_BETWEEN: Block.FlexContainer._Justify.ValueType # 4
103
+
104
+ class Justify(_Justify, metaclass=_JustifyEnumTypeWrapper): ...
105
+ JUSTIFY_UNDEFINED: Block.FlexContainer.Justify.ValueType # 0
106
+ JUSTIFY_START: Block.FlexContainer.Justify.ValueType # 1
107
+ JUSTIFY_END: Block.FlexContainer.Justify.ValueType # 2
108
+ JUSTIFY_CENTER: Block.FlexContainer.Justify.ValueType # 3
109
+ SPACE_BETWEEN: Block.FlexContainer.Justify.ValueType # 4
110
+
111
+ class _Align:
112
+ ValueType = typing.NewType("ValueType", builtins.int)
113
+ V: typing_extensions.TypeAlias = ValueType
114
+
115
+ class _AlignEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Block.FlexContainer._Align.ValueType], builtins.type):
116
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
117
+ ALIGN_UNDEFINED: Block.FlexContainer._Align.ValueType # 0
118
+ ALIGN_START: Block.FlexContainer._Align.ValueType # 1
119
+ ALIGN_END: Block.FlexContainer._Align.ValueType # 2
120
+ ALIGN_CENTER: Block.FlexContainer._Align.ValueType # 3
121
+ STRETCH: Block.FlexContainer._Align.ValueType # 4
122
+
123
+ class Align(_Align, metaclass=_AlignEnumTypeWrapper): ...
124
+ ALIGN_UNDEFINED: Block.FlexContainer.Align.ValueType # 0
125
+ ALIGN_START: Block.FlexContainer.Align.ValueType # 1
126
+ ALIGN_END: Block.FlexContainer.Align.ValueType # 2
127
+ ALIGN_CENTER: Block.FlexContainer.Align.ValueType # 3
128
+ STRETCH: Block.FlexContainer.Align.ValueType # 4
129
+
90
130
  BORDER_FIELD_NUMBER: builtins.int
91
131
  GAP_CONFIG_FIELD_NUMBER: builtins.int
92
132
  SCALE_FIELD_NUMBER: builtins.int
93
133
  DIRECTION_FIELD_NUMBER: builtins.int
94
134
  WRAP_FIELD_NUMBER: builtins.int
135
+ JUSTIFY_FIELD_NUMBER: builtins.int
136
+ ALIGN_FIELD_NUMBER: builtins.int
95
137
  border: builtins.bool
96
138
  scale: builtins.float
97
139
  direction: global___Block.FlexContainer.Direction.ValueType
98
140
  wrap: builtins.bool
141
+ justify: global___Block.FlexContainer.Justify.ValueType
142
+ align: global___Block.FlexContainer.Align.ValueType
99
143
  @property
100
144
  def gap_config(self) -> streamlit.proto.GapSize_pb2.GapConfig: ...
101
145
  def __init__(
@@ -106,9 +150,11 @@ class Block(google.protobuf.message.Message):
106
150
  scale: builtins.float = ...,
107
151
  direction: global___Block.FlexContainer.Direction.ValueType = ...,
108
152
  wrap: builtins.bool = ...,
153
+ justify: global___Block.FlexContainer.Justify.ValueType = ...,
154
+ align: global___Block.FlexContainer.Align.ValueType = ...,
109
155
  ) -> None: ...
110
156
  def HasField(self, field_name: typing.Literal["gap_config", b"gap_config"]) -> builtins.bool: ...
111
- def ClearField(self, field_name: typing.Literal["border", b"border", "direction", b"direction", "gap_config", b"gap_config", "scale", b"scale", "wrap", b"wrap"]) -> None: ...
157
+ def ClearField(self, field_name: typing.Literal["align", b"align", "border", b"border", "direction", b"direction", "gap_config", b"gap_config", "justify", b"justify", "scale", b"scale", "wrap", b"wrap"]) -> None: ...
112
158
 
113
159
  @typing.final
114
160
  class Column(google.protobuf.message.Message):
@@ -196,10 +242,13 @@ class Block(google.protobuf.message.Message):
196
242
  DISMISSIBLE_FIELD_NUMBER: builtins.int
197
243
  WIDTH_FIELD_NUMBER: builtins.int
198
244
  IS_OPEN_FIELD_NUMBER: builtins.int
245
+ ID_FIELD_NUMBER: builtins.int
199
246
  title: builtins.str
200
247
  dismissible: builtins.bool
201
248
  width: global___Block.Dialog.DialogWidth.ValueType
202
249
  is_open: builtins.bool
250
+ id: builtins.str
251
+ """If id is set, dismissal of the dialog will trigger a rerun."""
203
252
  def __init__(
204
253
  self,
205
254
  *,
@@ -207,9 +256,10 @@ class Block(google.protobuf.message.Message):
207
256
  dismissible: builtins.bool = ...,
208
257
  width: global___Block.Dialog.DialogWidth.ValueType = ...,
209
258
  is_open: builtins.bool | None = ...,
259
+ id: builtins.str = ...,
210
260
  ) -> None: ...
211
261
  def HasField(self, field_name: typing.Literal["_is_open", b"_is_open", "is_open", b"is_open"]) -> builtins.bool: ...
212
- def ClearField(self, field_name: typing.Literal["_is_open", b"_is_open", "dismissible", b"dismissible", "is_open", b"is_open", "title", b"title", "width", b"width"]) -> None: ...
262
+ def ClearField(self, field_name: typing.Literal["_is_open", b"_is_open", "dismissible", b"dismissible", "id", b"id", "is_open", b"is_open", "title", b"title", "width", b"width"]) -> None: ...
213
263
  def WhichOneof(self, oneof_group: typing.Literal["_is_open", b"_is_open"]) -> typing.Literal["is_open"] | None: ...
214
264
 
215
265
  @typing.final
@@ -266,6 +316,7 @@ class Block(google.protobuf.message.Message):
266
316
  ICON_FIELD_NUMBER: builtins.int
267
317
  label: builtins.str
268
318
  use_container_width: builtins.bool
319
+ """DEPRECATED: We use widthConfig on the top-level which is shared."""
269
320
  help: builtins.str
270
321
  disabled: builtins.bool
271
322
  icon: builtins.str
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
14
14
 
15
15
 
16
16
 
17
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cstreamlit/proto/Button.proto\"\xb9\x01\n\x06\x42utton\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x03 \x01(\x08\x12\x0c\n\x04help\x18\x04 \x01(\t\x12\x0f\n\x07\x66orm_id\x18\x05 \x01(\t\x12\x19\n\x11is_form_submitter\x18\x06 \x01(\x08\x12\x0c\n\x04type\x18\x07 \x01(\t\x12\x10\n\x08\x64isabled\x18\x08 \x01(\x08\x12\x1b\n\x13use_container_width\x18\t \x01(\x08\x12\x0c\n\x04icon\x18\n \x01(\tB+\n\x1c\x63om.snowflake.apps.streamlitB\x0b\x42uttonProtob\x06proto3')
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cstreamlit/proto/Button.proto\"\xbd\x01\n\x06\x42utton\x12\n\n\x02id\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x0f\n\x07\x64\x65\x66\x61ult\x18\x03 \x01(\x08\x12\x0c\n\x04help\x18\x04 \x01(\t\x12\x0f\n\x07\x66orm_id\x18\x05 \x01(\t\x12\x19\n\x11is_form_submitter\x18\x06 \x01(\x08\x12\x0c\n\x04type\x18\x07 \x01(\t\x12\x10\n\x08\x64isabled\x18\x08 \x01(\x08\x12\x1f\n\x13use_container_width\x18\t \x01(\x08\x42\x02\x18\x01\x12\x0c\n\x04icon\x18\n \x01(\tB+\n\x1c\x63om.snowflake.apps.streamlitB\x0b\x42uttonProtob\x06proto3')
18
18
 
19
19
  _globals = globals()
20
20
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -22,6 +22,8 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Button_pb2'
22
22
  if not _descriptor._USE_C_DESCRIPTORS:
23
23
  _globals['DESCRIPTOR']._loaded_options = None
24
24
  _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\013ButtonProto'
25
+ _globals['_BUTTON'].fields_by_name['use_container_width']._loaded_options = None
26
+ _globals['_BUTTON'].fields_by_name['use_container_width']._serialized_options = b'\030\001'
25
27
  _globals['_BUTTON']._serialized_start=33
26
- _globals['_BUTTON']._serialized_end=218
28
+ _globals['_BUTTON']._serialized_end=222
27
29
  # @@protoc_insertion_point(module_scope)
@@ -51,6 +51,7 @@ class Button(google.protobuf.message.Message):
51
51
  type: builtins.str
52
52
  disabled: builtins.bool
53
53
  use_container_width: builtins.bool
54
+ """DEPRECATED: Use widthConfig on Element.proto instead."""
54
55
  icon: builtins.str
55
56
  def __init__(
56
57
  self,
@@ -413,8 +413,21 @@ class CacheDataAPI:
413
413
  arguments match a previous function call. Alternatively, you can
414
414
  declare custom hashing functions with ``hash_funcs``.
415
415
 
416
- To cache global resources, use ``st.cache_resource`` instead. Learn more
417
- about caching at https://docs.streamlit.io/develop/concepts/architecture/caching.
416
+ Cached values are available to all users of your app. If you need to
417
+ save results that should only be accessible within a session, use
418
+ `Session State
419
+ <https://docs.streamlit.io/develop/concepts/architecture/session-state>`_
420
+ instead. Within each user session, an ``@st.cache_data``-decorated
421
+ function returns a *copy* of the cached return value (if the value is
422
+ already cached). To cache shared global resources (singletons), use
423
+ ``st.cache_resource`` instead. To learn more about caching, see
424
+ `Caching overview
425
+ <https://docs.streamlit.io/develop/concepts/architecture/caching>`_.
426
+
427
+ .. note::
428
+ Caching async functions is not supported. To upvote this feature,
429
+ see GitHub issue `#8308
430
+ <https://github.com/streamlit/streamlit/issues/8308>`_.
418
431
 
419
432
  Parameters
420
433
  ----------
@@ -64,7 +64,7 @@ class UnhashableParamError(StreamlitAPIException):
64
64
  ) -> str:
65
65
  arg_name_str = arg_name if arg_name is not None else "(unnamed)"
66
66
  arg_type = type_util.get_fqn_type(arg_value)
67
- func_name = func.__name__
67
+ func_name = func.__name__ if hasattr(func, "__name__") else "unknown"
68
68
  arg_replacement_name = f"_{arg_name}" if arg_name is not None else "_arg"
69
69
 
70
70
  return (
@@ -12,6 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+
15
16
  """@st.cache_resource implementation."""
16
17
 
17
18
  from __future__ import annotations
@@ -288,8 +289,29 @@ class CacheResourceAPI:
288
289
  arguments match a previous function call. Alternatively, you can
289
290
  declare custom hashing functions with ``hash_funcs``.
290
291
 
291
- To cache data, use ``st.cache_data`` instead. Learn more about caching at
292
- https://docs.streamlit.io/develop/concepts/architecture/caching.
292
+ Cached values are available to all users of your app. If you need to
293
+ save results that should only be accessible within a session, use
294
+ `Session State
295
+ <https://docs.streamlit.io/develop/concepts/architecture/session-state>`_
296
+ instead. Within each user session, an ``@st.cache_resource``-decorated
297
+ function returns the cached instance of the return value (if the value
298
+ is already cached). Therefore, objects cached by ``st.cache_resource``
299
+ act like singletons and can mutate. To cache data and return copies,
300
+ use ``st.cache_data`` instead. To learn more about caching, see
301
+ `Caching overview
302
+ <https://docs.streamlit.io/develop/concepts/architecture/caching>`_.
303
+
304
+ .. warning::
305
+ Async objects are not officially supported in Streamlit. Caching
306
+ async objects or objects that reference async objects may have
307
+ unintended consequences. For example, Streamlit may close event
308
+ loops in its normal operation and make the cached object raise an
309
+ ``Event loop closed`` error.
310
+
311
+ To upvote official ``asyncio`` support, see GitHub issue `#8488
312
+ <https://github.com/streamlit/streamlit/issues/8488>`_. To upvote
313
+ support for caching async functions, see GitHub issue `#8308
314
+ <https://github.com/streamlit/streamlit/issues/8308>`_.
293
315
 
294
316
  Parameters
295
317
  ----------
@@ -53,6 +53,8 @@ from streamlit.runtime.scriptrunner_utils.script_run_context import (
53
53
  )
54
54
 
55
55
  if TYPE_CHECKING:
56
+ import types
57
+
56
58
  from streamlit.runtime.caching.cache_type import CacheType
57
59
 
58
60
  _LOGGER: Final = get_logger(__name__)
@@ -122,7 +124,7 @@ class Cache(Generic[R]):
122
124
  raise NotImplementedError
123
125
 
124
126
 
125
- class CachedFuncInfo(Generic[P, R]):
127
+ class CachedFuncInfo(Generic[P, R]): # ty: ignore[invalid-argument-type]
126
128
  """Encapsulates data for a cached function instance.
127
129
 
128
130
  CachedFuncInfo instances are scoped to a single script run - they're not
@@ -168,7 +170,7 @@ def make_cached_func_wrapper(info: CachedFuncInfo[P, R]) -> CachedFunc[P, R]:
168
170
  return cast("CachedFunc[P, R]", functools.update_wrapper(cached_func, info.func))
169
171
 
170
172
 
171
- class BoundCachedFunc(Generic[P, R]):
173
+ class BoundCachedFunc(Generic[P, R]): # ty: ignore[invalid-argument-type]
172
174
  """A wrapper around a CachedFunc that binds it to a specific instance in case of
173
175
  decorated function is a class method.
174
176
  """
@@ -194,7 +196,7 @@ class BoundCachedFunc(Generic[P, R]):
194
196
  self._cached_func.clear()
195
197
 
196
198
 
197
- class CachedFunc(Generic[P, R]):
199
+ class CachedFunc(Generic[P, R]): # ty: ignore[invalid-argument-type]
198
200
  def __init__(self, info: CachedFuncInfo[P, R]) -> None:
199
201
  self._info = info
200
202
  self._function_key = _make_function_key(info.cache_type, info.func)
@@ -485,6 +487,7 @@ def _make_function_key(cache_type: CacheType, func: Callable[..., Any]) -> str:
485
487
  the function's source code changes.
486
488
  """
487
489
  func_hasher = hashlib.new("md5", usedforsecurity=False)
490
+ func = cast("types.FunctionType", func)
488
491
 
489
492
  # Include the function's __module__ and __qualname__ strings in the hash.
490
493
  # This means that two identical functions in different modules
@@ -46,6 +46,7 @@ from streamlit.runtime.uploaded_file_manager import UploadedFile
46
46
 
47
47
  if TYPE_CHECKING:
48
48
  import numpy.typing as npt
49
+ import pandas as pd
49
50
  from PIL.Image import Image
50
51
 
51
52
  _LOGGER: Final = logger.get_logger(__name__)
@@ -415,7 +416,7 @@ class _CacheFuncHasher:
415
416
  return str(obj).encode()
416
417
 
417
418
  if type_util.is_type(obj, "pandas.core.series.Series"):
418
- import pandas as pd
419
+ from pandas.util import hash_pandas_object
419
420
 
420
421
  series_obj: pd.Series = cast("pd.Series", obj)
421
422
  self.update(h, series_obj.size)
@@ -425,9 +426,7 @@ class _CacheFuncHasher:
425
426
  series_obj = series_obj.sample(n=_PANDAS_SAMPLE_SIZE, random_state=0)
426
427
 
427
428
  try:
428
- self.update(
429
- h, pd.util.hash_pandas_object(series_obj).to_numpy().tobytes()
430
- )
429
+ self.update(h, hash_pandas_object(series_obj).to_numpy().tobytes())
431
430
  return h.digest()
432
431
  except TypeError:
433
432
  _LOGGER.warning(
@@ -440,7 +439,7 @@ class _CacheFuncHasher:
440
439
  return b"%s" % pickle.dumps(series_obj, pickle.HIGHEST_PROTOCOL)
441
440
 
442
441
  elif type_util.is_type(obj, "pandas.core.frame.DataFrame"):
443
- import pandas as pd
442
+ from pandas.util import hash_pandas_object
444
443
 
445
444
  df_obj: pd.DataFrame = cast("pd.DataFrame", obj)
446
445
  self.update(h, df_obj.shape)
@@ -448,11 +447,9 @@ class _CacheFuncHasher:
448
447
  if len(df_obj) >= _PANDAS_ROWS_LARGE:
449
448
  df_obj = df_obj.sample(n=_PANDAS_SAMPLE_SIZE, random_state=0)
450
449
  try:
451
- column_hash_bytes = self.to_bytes(
452
- pd.util.hash_pandas_object(df_obj.dtypes)
453
- )
450
+ column_hash_bytes = self.to_bytes(hash_pandas_object(df_obj.dtypes))
454
451
  self.update(h, column_hash_bytes)
455
- values_hash_bytes = self.to_bytes(pd.util.hash_pandas_object(df_obj))
452
+ values_hash_bytes = self.to_bytes(hash_pandas_object(df_obj))
456
453
  self.update(h, values_hash_bytes)
457
454
  return h.digest()
458
455
  except TypeError:
@@ -35,6 +35,7 @@ from streamlit.runtime.scriptrunner_utils.exceptions import (
35
35
  )
36
36
  from streamlit.runtime.scriptrunner_utils.script_run_context import get_script_run_ctx
37
37
  from streamlit.time_util import time_to_seconds
38
+ from streamlit.type_util import get_object_name
38
39
  from streamlit.util import calc_md5
39
40
 
40
41
  if TYPE_CHECKING:
@@ -155,7 +156,7 @@ def _fragment(
155
156
  )
156
157
 
157
158
  return wrapper
158
- non_optional_func = func
159
+ non_optional_func: F = func
159
160
 
160
161
  @wraps(non_optional_func)
161
162
  def wrap(*args: Any, **kwargs: Any) -> Any:
@@ -168,7 +169,7 @@ def _fragment(
168
169
  cursors_snapshot = deepcopy(ctx.cursors)
169
170
  dg_stack_snapshot = deepcopy(context_dg_stack.get())
170
171
  fragment_id = calc_md5(
171
- f"{non_optional_func.__module__}.{non_optional_func.__qualname__}{dg_stack_snapshot[-1]._get_delta_path_str()}{additional_hash_info}"
172
+ f"{non_optional_func.__module__}.{get_object_name(non_optional_func)}{dg_stack_snapshot[-1]._get_delta_path_str()}{additional_hash_info}"
172
173
  )
173
174
 
174
175
  # We intentionally want to capture the active script hash here to ensure
@@ -15,6 +15,7 @@
15
15
  from __future__ import annotations
16
16
 
17
17
  import asyncio
18
+ import sys
18
19
  import time
19
20
  import traceback
20
21
  from dataclasses import dataclass, field
@@ -62,6 +63,10 @@ if TYPE_CHECKING:
62
63
  # Wait for the script run result for 60s and if no result is available give up
63
64
  SCRIPT_RUN_CHECK_TIMEOUT: Final = 60
64
65
 
66
+ # On Windows, periodically check for signals when blocked in asyncio.wait()
67
+ # This ensures Ctrl+C can be processed even when no sessions are connected
68
+ _SIGNAL_CHECK_INTERVAL: Final = 0.5 if sys.platform == "win32" else None
69
+
65
70
  _LOGGER: Final = get_logger(__name__)
66
71
 
67
72
 
@@ -609,16 +614,22 @@ class Runtime:
609
614
  # because it thinks self._state must be INITIAL | ONE_OR_MORE_SESSIONS_CONNECTED.
610
615
 
611
616
  # Wait for new websocket connections (new sessions):
612
- _, pending_tasks = await asyncio.wait( # type: ignore[unreachable]
617
+ done_tasks, pending_tasks = await asyncio.wait( # type: ignore[unreachable]
613
618
  (
614
619
  asyncio.create_task(async_objs.must_stop.wait()),
615
620
  asyncio.create_task(async_objs.has_connection.wait()),
616
621
  ),
617
622
  return_when=asyncio.FIRST_COMPLETED,
623
+ # On Windows, use a timeout to ensure signal handlers can be processed
624
+ timeout=_SIGNAL_CHECK_INTERVAL,
618
625
  )
619
626
  # Clean up pending tasks to avoid memory leaks
620
627
  for task in pending_tasks:
621
628
  task.cancel()
629
+
630
+ # If we timed out (Windows only), continue the loop to check must_stop
631
+ if not done_tasks and _SIGNAL_CHECK_INTERVAL is not None:
632
+ continue
622
633
  elif self._state == RuntimeState.ONE_OR_MORE_SESSIONS_CONNECTED:
623
634
  async_objs.need_send_data.clear()
624
635
 
@@ -643,12 +654,14 @@ class Runtime:
643
654
  break
644
655
 
645
656
  # Wait for new proto messages that need to be sent out:
646
- _, pending_tasks = await asyncio.wait(
657
+ done_tasks, pending_tasks = await asyncio.wait(
647
658
  (
648
659
  asyncio.create_task(async_objs.must_stop.wait()),
649
660
  asyncio.create_task(async_objs.need_send_data.wait()),
650
661
  ),
651
662
  return_when=asyncio.FIRST_COMPLETED,
663
+ # On Windows, use a timeout to ensure signal handlers can be processed
664
+ timeout=_SIGNAL_CHECK_INTERVAL,
652
665
  )
653
666
  # We need to cancel the pending tasks (the `must_stop` one in most situations).
654
667
  # Otherwise, this would stack up one waiting task per loop
@@ -657,6 +670,10 @@ class Runtime:
657
670
  for task in pending_tasks:
658
671
  task.cancel()
659
672
 
673
+ # If we timed out (Windows only), continue to check must_stop
674
+ if not done_tasks and _SIGNAL_CHECK_INTERVAL is not None:
675
+ continue
676
+
660
677
  # Shut down all AppSessions.
661
678
  for session_info in self._session_mgr.list_sessions():
662
679
  # NOTE: We want to fully shut down sessions when the runtime stops for
@@ -21,7 +21,7 @@ import types
21
21
  from contextlib import contextmanager
22
22
  from enum import Enum
23
23
  from timeit import default_timer as timer
24
- from typing import TYPE_CHECKING, Callable, Final, Literal, cast
24
+ from typing import TYPE_CHECKING, Any, Callable, Final, Literal, cast
25
25
 
26
26
  from blinker import Signal
27
27
 
@@ -762,7 +762,7 @@ def _clean_problem_modules() -> None:
762
762
  if "keras" in sys.modules:
763
763
  try:
764
764
  keras = sys.modules["keras"]
765
- keras.backend.clear_session()
765
+ cast("Any", keras).backend.clear_session()
766
766
  except Exception: # noqa: S110
767
767
  # We don't want to crash the app if we can't clear the Keras session.
768
768
  pass
@@ -770,7 +770,7 @@ def _clean_problem_modules() -> None:
770
770
  if "matplotlib.pyplot" in sys.modules:
771
771
  try:
772
772
  plt = sys.modules["matplotlib.pyplot"]
773
- plt.close("all")
773
+ cast("Any", plt).close("all")
774
774
  except Exception: # noqa: S110
775
775
  # We don't want to crash the app if we can't close matplotlib
776
776
  pass
@@ -24,6 +24,7 @@ from typing import (
24
24
  Generic,
25
25
  Literal,
26
26
  TypeVar,
27
+ Union,
27
28
  cast,
28
29
  get_args,
29
30
  )
@@ -43,7 +44,7 @@ T = TypeVar("T")
43
44
  T_co = TypeVar("T_co", covariant=True)
44
45
 
45
46
 
46
- WidgetArgs: TypeAlias = tuple[Any, ...]
47
+ WidgetArgs: TypeAlias = Union[tuple[Any, ...], list[Any]]
47
48
  WidgetKwargs: TypeAlias = dict[str, Any]
48
49
  WidgetCallback: TypeAlias = Callable[..., None]
49
50
 
@@ -16,7 +16,7 @@ from __future__ import annotations
16
16
 
17
17
  from collections.abc import Iterable, Iterator, MutableMapping
18
18
  from dataclasses import dataclass, field
19
- from typing import TYPE_CHECKING, Final
19
+ from typing import TYPE_CHECKING, Final, cast
20
20
  from urllib import parse
21
21
 
22
22
  from streamlit.errors import StreamlitAPIException
@@ -114,6 +114,7 @@ class QueryParams(MutableMapping[str, str]):
114
114
  # to ensure only one one ForwardMsg is sent.
115
115
  self._ensure_single_query_api_used()
116
116
  if hasattr(other, "keys") and hasattr(other, "__getitem__"):
117
+ other = cast("SupportsKeysAndGetItem[str, str | Iterable[str]]", other)
117
118
  for key in other.keys(): # noqa: SIM118
118
119
  self.__set_item_internal(key, other[key])
119
120
  else:
@@ -121,7 +121,7 @@ class WStates(MutableMapping[str, Any]):
121
121
 
122
122
  if is_array_value_field_name(value_field_name):
123
123
  # Array types are messages with data in a `data` field
124
- value = value.data
124
+ value = cast("Any", value).data
125
125
  elif value_field_name == "json_value":
126
126
  value = json.loads(cast("str", value))
127
127
 
@@ -37,7 +37,7 @@
37
37
  <script>
38
38
  window.prerenderReady = false
39
39
  </script>
40
- <script type="module" crossorigin src="./static/js/index.CbQtRkVt.js"></script>
40
+ <script type="module" crossorigin src="./static/js/index.DvRPFfw6.js"></script>
41
41
  <link rel="stylesheet" crossorigin href="./static/css/index.CJVRHjQZ.css">
42
42
  </head>
43
43
  <body>