streamlit-nightly 1.45.1.dev20250507__py3-none-any.whl → 1.45.1.dev20250509__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 (203) hide show
  1. streamlit/auth_util.py +3 -3
  2. streamlit/cli_util.py +3 -2
  3. streamlit/commands/logo.py +2 -2
  4. streamlit/commands/navigation.py +5 -4
  5. streamlit/commands/page_config.py +3 -1
  6. streamlit/components/types/base_custom_component.py +7 -7
  7. streamlit/components/v1/custom_component.py +6 -6
  8. streamlit/config.py +84 -48
  9. streamlit/config_option.py +2 -2
  10. streamlit/config_util.py +20 -12
  11. streamlit/connections/base_connection.py +3 -3
  12. streamlit/connections/snowflake_connection.py +5 -5
  13. streamlit/connections/snowpark_connection.py +3 -3
  14. streamlit/connections/sql_connection.py +9 -10
  15. streamlit/cursor.py +6 -6
  16. streamlit/delta_generator.py +7 -6
  17. streamlit/delta_generator_singletons.py +2 -2
  18. streamlit/deprecation_util.py +1 -1
  19. streamlit/elements/arrow.py +2 -3
  20. streamlit/elements/deck_gl_json_chart.py +30 -17
  21. streamlit/elements/dialog_decorator.py +3 -3
  22. streamlit/elements/doc_string.py +20 -20
  23. streamlit/elements/layouts.py +26 -7
  24. streamlit/elements/lib/built_in_chart_utils.py +37 -39
  25. streamlit/elements/lib/color_util.py +3 -3
  26. streamlit/elements/lib/column_types.py +2 -2
  27. streamlit/elements/lib/dialog.py +2 -2
  28. streamlit/elements/lib/event_utils.py +1 -1
  29. streamlit/elements/lib/mutable_status_container.py +1 -1
  30. streamlit/elements/lib/policies.py +3 -3
  31. streamlit/elements/lib/utils.py +5 -5
  32. streamlit/elements/map.py +20 -15
  33. streamlit/elements/progress.py +9 -12
  34. streamlit/elements/vega_charts.py +2 -2
  35. streamlit/elements/widgets/button_group.py +2 -2
  36. streamlit/elements/widgets/data_editor.py +2 -2
  37. streamlit/elements/widgets/multiselect.py +2 -2
  38. streamlit/elements/widgets/selectbox.py +1 -1
  39. streamlit/elements/widgets/slider.py +16 -14
  40. streamlit/elements/write.py +3 -6
  41. streamlit/errors.py +34 -21
  42. streamlit/external/langchain/streamlit_callback_handler.py +2 -2
  43. streamlit/file_util.py +8 -8
  44. streamlit/git_util.py +1 -1
  45. streamlit/hello/dataframe_demo.py +1 -1
  46. streamlit/hello/mapping_demo.py +1 -1
  47. streamlit/navigation/page.py +1 -1
  48. streamlit/proto/Block_pb2.py +38 -29
  49. streamlit/proto/Block_pb2.pyi +68 -4
  50. streamlit/proto/DeckGlJsonChart_pb2.pyi +1 -1
  51. streamlit/proto/GapSize_pb2.py +29 -0
  52. streamlit/proto/GapSize_pb2.pyi +70 -0
  53. streamlit/proto/HeightConfig_pb2.py +27 -0
  54. streamlit/proto/HeightConfig_pb2.pyi +48 -0
  55. streamlit/proto/WidthConfig_pb2.py +2 -2
  56. streamlit/proto/WidthConfig_pb2.pyi +15 -1
  57. streamlit/runtime/app_session.py +2 -2
  58. streamlit/runtime/caching/cache_data_api.py +9 -5
  59. streamlit/runtime/caching/cache_errors.py +3 -3
  60. streamlit/runtime/caching/cache_resource_api.py +7 -7
  61. streamlit/runtime/caching/cache_utils.py +9 -9
  62. streamlit/runtime/caching/cached_message_replay.py +1 -1
  63. streamlit/runtime/caching/hashing.py +70 -74
  64. streamlit/runtime/caching/legacy_cache_api.py +1 -1
  65. streamlit/runtime/caching/storage/in_memory_cache_storage_wrapper.py +3 -1
  66. streamlit/runtime/caching/storage/local_disk_cache_storage.py +1 -1
  67. streamlit/runtime/connection_factory.py +12 -12
  68. streamlit/runtime/context.py +2 -2
  69. streamlit/runtime/credentials.py +3 -3
  70. streamlit/runtime/fragment.py +3 -4
  71. streamlit/runtime/media_file_manager.py +2 -2
  72. streamlit/runtime/memory_media_file_storage.py +1 -1
  73. streamlit/runtime/memory_uploaded_file_manager.py +1 -1
  74. streamlit/runtime/metrics_util.py +5 -6
  75. streamlit/runtime/pages_manager.py +3 -3
  76. streamlit/runtime/runtime.py +1 -1
  77. streamlit/runtime/runtime_util.py +2 -2
  78. streamlit/runtime/scriptrunner/exec_code.py +10 -3
  79. streamlit/runtime/scriptrunner/magic.py +13 -8
  80. streamlit/runtime/scriptrunner/script_runner.py +2 -2
  81. streamlit/runtime/scriptrunner_utils/exceptions.py +1 -1
  82. streamlit/runtime/scriptrunner_utils/script_run_context.py +6 -5
  83. streamlit/runtime/secrets.py +8 -11
  84. streamlit/runtime/state/query_params.py +2 -2
  85. streamlit/runtime/state/safe_session_state.py +2 -2
  86. streamlit/runtime/state/session_state.py +17 -15
  87. streamlit/runtime/stats.py +1 -1
  88. streamlit/runtime/uploaded_file_manager.py +1 -1
  89. streamlit/source_util.py +3 -4
  90. streamlit/static/index.html +1 -1
  91. streamlit/static/static/js/{ErrorOutline.esm.BgsGCsV4.js → ErrorOutline.esm.C-0hf1-k.js} +1 -1
  92. streamlit/static/static/js/{FileDownload.esm.CCKezPn5.js → FileDownload.esm.B-fFGI-X.js} +1 -1
  93. streamlit/static/static/js/{FileHelper.CprSF_kT.js → FileHelper.ACYo0OZo.js} +1 -1
  94. streamlit/static/static/js/{FormClearHelper.DiwQ0EtT.js → FormClearHelper.CVNTT-bJ.js} +1 -1
  95. streamlit/static/static/js/{Hooks.DDqhyZ1_.js → Hooks.C3thlpd2.js} +1 -1
  96. streamlit/static/static/js/{InputInstructions.BCEZxme4.js → InputInstructions.CwAxousX.js} +1 -1
  97. streamlit/static/static/js/{ProgressBar.CGdY94g_.js → ProgressBar.xh599Rum.js} +2 -2
  98. streamlit/static/static/js/{RenderInPortalIfExists.uGJp_Q0v.js → RenderInPortalIfExists.CQLIsNPE.js} +1 -1
  99. streamlit/static/static/js/{Toolbar.hTlw0-K1.js → Toolbar.LKdyvP0u.js} +1 -1
  100. streamlit/static/static/js/{index.xsH4HHeE.js → UploadFileInfo.0DCkpDDf.js} +5 -5
  101. streamlit/static/static/js/{base-input.mGTY3-qU.js → base-input.D8OdS4WW.js} +4 -4
  102. streamlit/static/static/js/{checkbox.Cg-5cKAh.js → checkbox.DSdYKlOI.js} +2 -2
  103. streamlit/static/static/js/{createSuper.-HPb1oYT.js → createSuper.B2pyCfWw.js} +1 -1
  104. streamlit/static/static/js/{data-grid-overlay-editor.BpNYxiTp.js → data-grid-overlay-editor.DhO2r0ne.js} +1 -1
  105. streamlit/static/static/js/{downloader.DS9891pS.js → downloader.C24skoDM.js} +1 -1
  106. streamlit/static/static/js/{es6.CU1PEL2w.js → es6.DHkvCKPh.js} +2 -2
  107. streamlit/static/static/js/{iframeResizer.contentWindow.CgJE2bJN.js → iframeResizer.contentWindow.2ckQaC2c.js} +1 -1
  108. streamlit/static/static/js/index.0dGwl8CJ.js +1 -0
  109. streamlit/static/static/js/index.B5A28NpR.js +1 -0
  110. streamlit/static/static/js/{index.BC0ueJ8H.js → index.B5EFweZ4.js} +1 -1
  111. streamlit/static/static/js/{index.CyGuL4If.js → index.BAafqHfB.js} +2 -2
  112. streamlit/static/static/js/{index.DWV80Vyw.js → index.BHTbGZPQ.js} +1 -1
  113. streamlit/static/static/js/index.BNXtQAj4.js +1 -0
  114. streamlit/static/static/js/index.BRhKaVdO.js +1 -0
  115. streamlit/static/static/js/index.BSOiJVQd.js +2 -0
  116. streamlit/static/static/js/{index.GSYBrzVp.js → index.BVgTQbOJ.js} +1 -1
  117. streamlit/static/static/js/{index.BTTj6ld4.js → index.BflIniLm.js} +1 -1
  118. streamlit/static/static/js/{index.DLTqo4pp.js → index.BjeNtZIz.js} +3 -3
  119. streamlit/static/static/js/{index.DZ6oX-v9.js → index.By-NmdnB.js} +161 -161
  120. streamlit/static/static/js/{index.DVpzZJNg.js → index.CIoOEhZ2.js} +1 -1
  121. streamlit/static/static/js/{index.CN91oQMB.js → index.CRCdonis.js} +36 -36
  122. streamlit/static/static/js/index.CRxaBCJ7.js +1 -0
  123. streamlit/static/static/js/index.CU-pbYVN.js +1 -0
  124. streamlit/static/static/js/{index.CzGUd4IN.js → index.CUsk52t2.js} +1 -1
  125. streamlit/static/static/js/{index.BHVQ94t4.js → index.CVO14oQG.js} +2 -2
  126. streamlit/static/static/js/index.CXFuA6J-.js +1 -0
  127. streamlit/static/static/js/{index.DJHUlWgy.js → index.C_dd5q7u.js} +1 -1
  128. streamlit/static/static/js/{index.Bph6ZoI5.js → index.CjWUnKIN.js} +1 -1
  129. streamlit/static/static/js/{index.B209tswL.js → index.CkTL9bAR.js} +256 -256
  130. streamlit/static/static/js/{index.ErkF0SoX.js → index.CsbhsAPy.js} +2 -2
  131. streamlit/static/static/js/{index.hPjr68pz.js → index.CtCnBUtk.js} +1 -1
  132. streamlit/static/static/js/{index.BT0p7gAu.js → index.CwuKadAX.js} +1 -1
  133. streamlit/static/static/js/{index.CtoDsUtq.js → index.D0R7Xh4Z.js} +1 -1
  134. streamlit/static/static/js/index.D2D75EDw.js +73 -0
  135. streamlit/static/static/js/index.D4eMiZ1F.js +1 -0
  136. streamlit/static/static/js/{index.Dh4RKl-F.js → index.D7SCC3z9.js} +1 -1
  137. streamlit/static/static/js/index.DZiilxEt.js +1 -0
  138. streamlit/static/static/js/{index.DtqvdV-p.js → index.Dvr1cEJS.js} +1 -1
  139. streamlit/static/static/js/index.JtIlC6Uq.js +1 -0
  140. streamlit/static/static/js/index.fz_c3Xh_.js +1 -0
  141. streamlit/static/static/js/{index.CvFsF3FD.js → index.gFjPlsMT.js} +1 -1
  142. streamlit/static/static/js/{index.DPJBu2uZ.js → index.jCJYMVED.js} +1 -1
  143. streamlit/static/static/js/index.xldt56AE.js +1 -0
  144. streamlit/static/static/js/{index.Bb-Ukg41.js → index.yzoj_DuM.js} +1 -1
  145. streamlit/static/static/js/{input.DY17i94N.js → input.BP6LX_Bg.js} +2 -2
  146. streamlit/static/static/js/{memory.DsIIcbSd.js → memory.E9x2ZYJv.js} +1 -1
  147. streamlit/static/static/js/{mergeWith.cRgGdgvI.js → mergeWith.CZP2AaVS.js} +1 -1
  148. streamlit/static/static/js/{number-overlay-editor.B8Xi2dYq.js → number-overlay-editor.D-Kl79U_.js} +1 -1
  149. streamlit/static/static/js/{possibleConstructorReturn.BgDi5nUm.js → possibleConstructorReturn.P2ILVC_6.js} +1 -1
  150. streamlit/static/static/js/{sandbox.BH9emp13.js → sandbox.DfzJIGMV.js} +1 -1
  151. streamlit/static/static/js/{textarea.DAyShsGG.js → textarea.4PjzfDWF.js} +2 -2
  152. streamlit/static/static/js/{timepicker.CCH2R2Y0.js → timepicker.DMQdaNzO.js} +1 -1
  153. streamlit/static/static/js/{toConsumableArray.CNffSDCu.js → toConsumableArray.BEdkbHYx.js} +1 -1
  154. streamlit/static/static/js/{uniqueId.B49CstkV.js → uniqueId.CAs7ftHC.js} +1 -1
  155. streamlit/static/static/js/{useBasicWidgetState.CkThOkF9.js → useBasicWidgetState.Cedp0V76.js} +1 -1
  156. streamlit/static/static/js/useOnInputChange.CvRKHHKx.js +1 -0
  157. streamlit/static/static/js/{withFullScreenWrapper.UsvF_Jwr.js → withFullScreenWrapper.BbmjZAzW.js} +1 -1
  158. streamlit/string_util.py +6 -7
  159. streamlit/temporary_directory.py +12 -3
  160. streamlit/testing/v1/app_test.py +11 -6
  161. streamlit/testing/v1/element_tree.py +134 -158
  162. streamlit/testing/v1/local_script_runner.py +5 -5
  163. streamlit/testing/v1/util.py +11 -4
  164. streamlit/type_util.py +3 -4
  165. streamlit/user_info.py +3 -2
  166. streamlit/util.py +1 -1
  167. streamlit/watcher/event_based_path_watcher.py +1 -1
  168. streamlit/watcher/folder_black_list.py +1 -1
  169. streamlit/watcher/local_sources_watcher.py +5 -5
  170. streamlit/watcher/path_watcher.py +1 -1
  171. streamlit/web/bootstrap.py +2 -1
  172. streamlit/web/cli.py +12 -11
  173. streamlit/web/server/browser_websocket_handler.py +1 -1
  174. streamlit/web/server/component_request_handler.py +1 -1
  175. streamlit/web/server/media_file_handler.py +2 -1
  176. streamlit/web/server/oauth_authlib_routes.py +9 -2
  177. streamlit/web/server/oidc_mixin.py +13 -6
  178. streamlit/web/server/routes.py +3 -3
  179. streamlit/web/server/server.py +1 -1
  180. streamlit/web/server/server_util.py +7 -6
  181. streamlit/web/server/upload_file_request_handler.py +5 -5
  182. {streamlit_nightly-1.45.1.dev20250507.dist-info → streamlit_nightly-1.45.1.dev20250509.dist-info}/METADATA +1 -1
  183. {streamlit_nightly-1.45.1.dev20250507.dist-info → streamlit_nightly-1.45.1.dev20250509.dist-info}/RECORD +187 -184
  184. {streamlit_nightly-1.45.1.dev20250507.dist-info → streamlit_nightly-1.45.1.dev20250509.dist-info}/WHEEL +1 -1
  185. streamlit/static/static/js/UploadFileInfo.C-jY39rj.js +0 -1
  186. streamlit/static/static/js/index.BVjgrQ4R.js +0 -1
  187. streamlit/static/static/js/index.BXYstdPh.js +0 -2
  188. streamlit/static/static/js/index.BZ9mqzEJ.js +0 -1
  189. streamlit/static/static/js/index.BhTok8vt.js +0 -1
  190. streamlit/static/static/js/index.CJPcdxPe.js +0 -1
  191. streamlit/static/static/js/index.CMOA-8Q2.js +0 -1
  192. streamlit/static/static/js/index.DAxf3_iz.js +0 -1
  193. streamlit/static/static/js/index.Dn76KVNf.js +0 -1
  194. streamlit/static/static/js/index.OngWTN39.js +0 -1
  195. streamlit/static/static/js/index.PSwG8ayC.js +0 -1
  196. streamlit/static/static/js/index.UTlCdasa.js +0 -73
  197. streamlit/static/static/js/index.eR_vQpeg.js +0 -1
  198. streamlit/static/static/js/index.fLsU9uCJ.js +0 -1
  199. streamlit/static/static/js/index.kXOZCC_6.js +0 -1
  200. streamlit/static/static/js/useOnInputChange.BqEq0xFZ.js +0 -1
  201. {streamlit_nightly-1.45.1.dev20250507.data → streamlit_nightly-1.45.1.dev20250509.data}/scripts/streamlit.cmd +0 -0
  202. {streamlit_nightly-1.45.1.dev20250507.dist-info → streamlit_nightly-1.45.1.dev20250509.dist-info}/entry_points.txt +0 -0
  203. {streamlit_nightly-1.45.1.dev20250507.dist-info → streamlit_nightly-1.45.1.dev20250509.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,70 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ *!
5
+ Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+ """
19
+
20
+ import builtins
21
+ import google.protobuf.descriptor
22
+ import google.protobuf.internal.enum_type_wrapper
23
+ import google.protobuf.message
24
+ import sys
25
+ import typing
26
+
27
+ if sys.version_info >= (3, 10):
28
+ import typing as typing_extensions
29
+ else:
30
+ import typing_extensions
31
+
32
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
33
+
34
+ class _GapSize:
35
+ ValueType = typing.NewType("ValueType", builtins.int)
36
+ V: typing_extensions.TypeAlias = ValueType
37
+
38
+ class _GapSizeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_GapSize.ValueType], builtins.type):
39
+ DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
40
+ GAP_UNDEFINED: _GapSize.ValueType # 0
41
+ SMALL: _GapSize.ValueType # 1
42
+ MEDIUM: _GapSize.ValueType # 2
43
+ LARGE: _GapSize.ValueType # 3
44
+ NONE: _GapSize.ValueType # 4
45
+
46
+ class GapSize(_GapSize, metaclass=_GapSizeEnumTypeWrapper): ...
47
+
48
+ GAP_UNDEFINED: GapSize.ValueType # 0
49
+ SMALL: GapSize.ValueType # 1
50
+ MEDIUM: GapSize.ValueType # 2
51
+ LARGE: GapSize.ValueType # 3
52
+ NONE: GapSize.ValueType # 4
53
+ global___GapSize = GapSize
54
+
55
+ @typing.final
56
+ class GapConfig(google.protobuf.message.Message):
57
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
58
+
59
+ GAP_SIZE_FIELD_NUMBER: builtins.int
60
+ gap_size: global___GapSize.ValueType
61
+ def __init__(
62
+ self,
63
+ *,
64
+ gap_size: global___GapSize.ValueType = ...,
65
+ ) -> None: ...
66
+ def HasField(self, field_name: typing.Literal["gap_size", b"gap_size", "gap_spec", b"gap_spec"]) -> builtins.bool: ...
67
+ def ClearField(self, field_name: typing.Literal["gap_size", b"gap_size", "gap_spec", b"gap_spec"]) -> None: ...
68
+ def WhichOneof(self, oneof_group: typing.Literal["gap_spec", b"gap_spec"]) -> typing.Literal["gap_size"] | None: ...
69
+
70
+ global___GapConfig = GapConfig
@@ -0,0 +1,27 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: streamlit/proto/HeightConfig.proto
4
+ # Protobuf Python Version: 5.26.1
5
+ """Generated protocol buffer code."""
6
+ from google.protobuf import descriptor as _descriptor
7
+ from google.protobuf import descriptor_pool as _descriptor_pool
8
+ from google.protobuf import symbol_database as _symbol_database
9
+ from google.protobuf.internal import builder as _builder
10
+ # @@protoc_insertion_point(imports)
11
+
12
+ _sym_db = _symbol_database.Default()
13
+
14
+
15
+
16
+
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"streamlit/proto/HeightConfig.proto\x12\tstreamlit\"c\n\x0cHeightConfig\x12\x15\n\x0buse_stretch\x18\x01 \x01(\x08H\x00\x12\x15\n\x0buse_content\x18\x02 \x01(\x08H\x00\x12\x16\n\x0cpixel_height\x18\x03 \x01(\rH\x00\x42\r\n\x0bheight_specB1\n\x1c\x63om.snowflake.apps.streamlitB\x11HeightConfigProtob\x06proto3')
18
+
19
+ _globals = globals()
20
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.HeightConfig_pb2', _globals)
22
+ if not _descriptor._USE_C_DESCRIPTORS:
23
+ _globals['DESCRIPTOR']._loaded_options = None
24
+ _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\021HeightConfigProto'
25
+ _globals['_HEIGHTCONFIG']._serialized_start=49
26
+ _globals['_HEIGHTCONFIG']._serialized_end=148
27
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,48 @@
1
+ """
2
+ @generated by mypy-protobuf. Do not edit manually!
3
+ isort:skip_file
4
+ *!
5
+ Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+ """
19
+
20
+ import builtins
21
+ import google.protobuf.descriptor
22
+ import google.protobuf.message
23
+ import typing
24
+
25
+ DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
26
+
27
+ @typing.final
28
+ class HeightConfig(google.protobuf.message.Message):
29
+ DESCRIPTOR: google.protobuf.descriptor.Descriptor
30
+
31
+ USE_STRETCH_FIELD_NUMBER: builtins.int
32
+ USE_CONTENT_FIELD_NUMBER: builtins.int
33
+ PIXEL_HEIGHT_FIELD_NUMBER: builtins.int
34
+ use_stretch: builtins.bool
35
+ use_content: builtins.bool
36
+ pixel_height: builtins.int
37
+ def __init__(
38
+ self,
39
+ *,
40
+ use_stretch: builtins.bool = ...,
41
+ use_content: builtins.bool = ...,
42
+ pixel_height: builtins.int = ...,
43
+ ) -> None: ...
44
+ def HasField(self, field_name: typing.Literal["height_spec", b"height_spec", "pixel_height", b"pixel_height", "use_content", b"use_content", "use_stretch", b"use_stretch"]) -> builtins.bool: ...
45
+ def ClearField(self, field_name: typing.Literal["height_spec", b"height_spec", "pixel_height", b"pixel_height", "use_content", b"use_content", "use_stretch", b"use_stretch"]) -> None: ...
46
+ def WhichOneof(self, oneof_group: typing.Literal["height_spec", b"height_spec"]) -> typing.Literal["use_stretch", "use_content", "pixel_height"] | None: ...
47
+
48
+ global___HeightConfig = HeightConfig
@@ -14,14 +14,14 @@ _sym_db = _symbol_database.Default()
14
14
 
15
15
 
16
16
 
17
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!streamlit/proto/WidthConfig.proto\x12\tstreamlit\"`\n\x0bWidthConfig\x12\x15\n\x0buse_stretch\x18\x01 \x01(\x08H\x00\x12\x15\n\x0buse_content\x18\x02 \x01(\x08H\x00\x12\x15\n\x0bpixel_width\x18\x03 \x01(\rH\x00\x42\x0c\n\nwidth_specB+\n\x1c\x63om.snowflake.apps.streamlitB\x0bLayoutProtob\x06proto3')
17
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!streamlit/proto/WidthConfig.proto\x12\tstreamlit\"`\n\x0bWidthConfig\x12\x15\n\x0buse_stretch\x18\x01 \x01(\x08H\x00\x12\x15\n\x0buse_content\x18\x02 \x01(\x08H\x00\x12\x15\n\x0bpixel_width\x18\x03 \x01(\rH\x00\x42\x0c\n\nwidth_specB0\n\x1c\x63om.snowflake.apps.streamlitB\x10WidthConfigProtob\x06proto3')
18
18
 
19
19
  _globals = globals()
20
20
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
21
21
  _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.WidthConfig_pb2', _globals)
22
22
  if not _descriptor._USE_C_DESCRIPTORS:
23
23
  _globals['DESCRIPTOR']._loaded_options = None
24
- _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\013LayoutProto'
24
+ _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\020WidthConfigProto'
25
25
  _globals['_WIDTHCONFIG']._serialized_start=48
26
26
  _globals['_WIDTHCONFIG']._serialized_end=144
27
27
  # @@protoc_insertion_point(module_scope)
@@ -1,7 +1,21 @@
1
1
  """
2
2
  @generated by mypy-protobuf. Do not edit manually!
3
3
  isort:skip_file
4
- Common layout-related enums and messages that can be reused across different elements."""
4
+ *!
5
+ Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+ """
5
19
 
6
20
  import builtins
7
21
  import google.protobuf.descriptor
@@ -20,7 +20,7 @@ import os
20
20
  import sys
21
21
  import uuid
22
22
  from enum import Enum
23
- from typing import TYPE_CHECKING, Callable, Final
23
+ from typing import TYPE_CHECKING, Any, Callable, Final
24
24
 
25
25
  from google.protobuf.json_format import ParseDict
26
26
 
@@ -480,7 +480,7 @@ class AppSession:
480
480
  else:
481
481
  self._enqueue_forward_msg(self._create_file_change_message())
482
482
 
483
- def _on_secrets_file_changed(self, _) -> None:
483
+ def _on_secrets_file_changed(self, _: Any) -> None:
484
484
  """Called when `secrets.file_change_listener` emits a Signal."""
485
485
 
486
486
  # NOTE: At the time of writing, this function only calls
@@ -83,6 +83,10 @@ CachePersistType: TypeAlias = Union[Literal["disk"], None]
83
83
  class CachedDataFuncInfo(CachedFuncInfo):
84
84
  """Implements the CachedFuncInfo interface for @st.cache_data."""
85
85
 
86
+ persist: CachePersistType
87
+ max_entries: int | None
88
+ ttl: float | timedelta | str | None
89
+
86
90
  def __init__(
87
91
  self,
88
92
  func: types.FunctionType,
@@ -91,7 +95,7 @@ class CachedDataFuncInfo(CachedFuncInfo):
91
95
  max_entries: int | None,
92
96
  ttl: float | timedelta | str | None,
93
97
  hash_funcs: HashFuncsDict | None = None,
94
- ):
98
+ ) -> None:
95
99
  super().__init__(
96
100
  func,
97
101
  show_spinner=show_spinner,
@@ -317,7 +321,7 @@ class CacheDataAPI:
317
321
  st.cache_data.clear().
318
322
  """
319
323
 
320
- def __init__(self, decorator_metric_name: str):
324
+ def __init__(self, decorator_metric_name: str) -> None:
321
325
  """Create a CacheDataAPI instance.
322
326
 
323
327
  Parameters
@@ -363,7 +367,7 @@ class CacheDataAPI:
363
367
  persist: CachePersistType | bool = None,
364
368
  experimental_allow_widgets: bool = False,
365
369
  hash_funcs: HashFuncsDict | None = None,
366
- ):
370
+ ) -> F | Callable[[F], F]:
367
371
  return self._decorator(
368
372
  func,
369
373
  ttl=ttl,
@@ -384,7 +388,7 @@ class CacheDataAPI:
384
388
  persist: CachePersistType | bool,
385
389
  experimental_allow_widgets: bool,
386
390
  hash_funcs: HashFuncsDict | None = None,
387
- ):
391
+ ) -> F | Callable[[F], F]:
388
392
  """Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).
389
393
 
390
394
  Cached objects are stored in "pickled" form, which means that the return
@@ -605,7 +609,7 @@ class DataCache(Cache):
605
609
  max_entries: int | None,
606
610
  ttl_seconds: float | None,
607
611
  display_name: str,
608
- ):
612
+ ) -> None:
609
613
  super().__init__()
610
614
  self.key = key
611
615
  self.display_name = display_name
@@ -53,7 +53,7 @@ class UnhashableParamError(StreamlitAPIException):
53
53
  arg_name: str | None,
54
54
  arg_value: Any,
55
55
  orig_exc: BaseException,
56
- ):
56
+ ) -> None:
57
57
  msg = self._create_message(cache_type, func, arg_name, arg_value)
58
58
  super().__init__(msg)
59
59
  self.with_traceback(orig_exc.__traceback__)
@@ -99,7 +99,7 @@ class CacheReplayClosureError(StreamlitAPIException):
99
99
  self,
100
100
  cache_type: CacheType,
101
101
  cached_func: FunctionType,
102
- ):
102
+ ) -> None:
103
103
  func_name = get_cached_func_name_md(cached_func)
104
104
  decorator_name = get_decorator_api_name(cache_type)
105
105
 
@@ -121,7 +121,7 @@ How to fix this:
121
121
 
122
122
 
123
123
  class UnserializableReturnValueError(MarkdownFormattedException):
124
- def __init__(self, func: FunctionType, return_value: FunctionType):
124
+ def __init__(self, func: FunctionType, return_value: FunctionType) -> None:
125
125
  MarkdownFormattedException.__init__(
126
126
  self,
127
127
  f"""
@@ -151,7 +151,7 @@ class CachedResourceFuncInfo(CachedFuncInfo):
151
151
  ttl: float | timedelta | str | None,
152
152
  validate: ValidateFunc | None,
153
153
  hash_funcs: HashFuncsDict | None = None,
154
- ):
154
+ ) -> None:
155
155
  super().__init__(
156
156
  func,
157
157
  show_spinner=show_spinner,
@@ -189,7 +189,7 @@ class CacheResourceAPI:
189
189
  and st.cache_resource.clear().
190
190
  """
191
191
 
192
- def __init__(self, decorator_metric_name: str):
192
+ def __init__(self, decorator_metric_name: str) -> None:
193
193
  """Create a CacheResourceAPI instance.
194
194
 
195
195
  Parameters
@@ -234,7 +234,7 @@ class CacheResourceAPI:
234
234
  validate: ValidateFunc | None = None,
235
235
  experimental_allow_widgets: bool = False,
236
236
  hash_funcs: HashFuncsDict | None = None,
237
- ):
237
+ ) -> F | Callable[[F], F]:
238
238
  return self._decorator(
239
239
  func,
240
240
  ttl=ttl,
@@ -255,7 +255,7 @@ class CacheResourceAPI:
255
255
  validate: ValidateFunc | None,
256
256
  experimental_allow_widgets: bool,
257
257
  hash_funcs: HashFuncsDict | None = None,
258
- ):
258
+ ) -> F | Callable[[F], F]:
259
259
  """Decorator to cache functions that return global resources (e.g. database connections, ML models).
260
260
 
261
261
  Cached objects are shared across all users, sessions, and reruns. They
@@ -417,9 +417,9 @@ class CacheResourceAPI:
417
417
  # Support passing the params via function decorator, e.g.
418
418
  # @st.cache_resource(show_spinner=False)
419
419
  if func is None:
420
- return lambda f: make_cached_func_wrapper(
420
+ return lambda f: make_cached_func_wrapper( # type: ignore
421
421
  CachedResourceFuncInfo(
422
- func=f,
422
+ func=f, # type: ignore
423
423
  show_spinner=show_spinner,
424
424
  max_entries=max_entries,
425
425
  ttl=ttl,
@@ -455,7 +455,7 @@ class ResourceCache(Cache):
455
455
  ttl_seconds: float,
456
456
  validate: ValidateFunc | None,
457
457
  display_name: str,
458
- ):
458
+ ) -> None:
459
459
  super().__init__()
460
460
  self.key = key
461
461
  self.display_name = display_name
@@ -100,7 +100,7 @@ class Cache:
100
100
  with self._value_locks_lock:
101
101
  return self._value_locks[value_key]
102
102
 
103
- def clear(self, key: str | None = None):
103
+ def clear(self, key: str | None = None) -> None:
104
104
  """Clear values from this cache.
105
105
  If no argument is passed, all items are cleared from the cache.
106
106
  A key can be passed to clear that key from the cache only.
@@ -130,7 +130,7 @@ class CachedFuncInfo:
130
130
  func: FunctionType,
131
131
  show_spinner: bool | str,
132
132
  hash_funcs: HashFuncsDict | None,
133
- ):
133
+ ) -> None:
134
134
  self.func = func
135
135
  self.show_spinner = show_spinner
136
136
  self.hash_funcs = hash_funcs
@@ -167,17 +167,17 @@ class BoundCachedFunc:
167
167
  decorated function is a class method.
168
168
  """
169
169
 
170
- def __init__(self, cached_func: CachedFunc, instance: Any):
170
+ def __init__(self, cached_func: CachedFunc, instance: Any) -> None:
171
171
  self._cached_func = cached_func
172
172
  self._instance = instance
173
173
 
174
- def __call__(self, *args, **kwargs) -> Any:
174
+ def __call__(self, *args: Any, **kwargs: Any) -> Any:
175
175
  return self._cached_func(self._instance, *args, **kwargs)
176
176
 
177
- def __repr__(self):
177
+ def __repr__(self) -> str:
178
178
  return f"<BoundCachedFunc: {self._cached_func._info.func} of {self._instance}>"
179
179
 
180
- def clear(self, *args, **kwargs):
180
+ def clear(self, *args: Any, **kwargs: Any) -> None:
181
181
  if args or kwargs:
182
182
  # The instance is required as first parameter to allow
183
183
  # args to be correctly resolved to the parameter names:
@@ -189,11 +189,11 @@ class BoundCachedFunc:
189
189
 
190
190
 
191
191
  class CachedFunc:
192
- def __init__(self, info: CachedFuncInfo):
192
+ def __init__(self, info: CachedFuncInfo) -> None:
193
193
  self._info = info
194
194
  self._function_key = _make_function_key(info.cache_type, info.func)
195
195
 
196
- def __repr__(self):
196
+ def __repr__(self) -> str:
197
197
  return f"<CachedFunc: {self._info.func}>"
198
198
 
199
199
  def __get__(self, instance, owner=None):
@@ -203,7 +203,7 @@ class CachedFunc:
203
203
 
204
204
  return functools.update_wrapper(BoundCachedFunc(self, instance), self)
205
205
 
206
- def __call__(self, *args, **kwargs) -> Any:
206
+ def __call__(self, *args: Any, **kwargs: Any) -> Any:
207
207
  """The wrapper. We'll only call our underlying function on a cache miss."""
208
208
 
209
209
  spinner_message: str | None = None
@@ -121,7 +121,7 @@ class CachedMessageReplayContext(threading.local):
121
121
  of this class across multiple threads.
122
122
  """
123
123
 
124
- def __init__(self, cache_type: CacheType):
124
+ def __init__(self, cache_type: CacheType) -> None:
125
125
  self._cached_message_stack: list[list[MsgData]] = []
126
126
  self._seen_dg_stack: list[set[str]] = []
127
127
  self._most_recent_messages: list[MsgData] = []