streamlit-nightly 1.44.2.dev20250427__py3-none-any.whl → 1.44.2.dev20250428__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 (131) hide show
  1. streamlit/auth_util.py +1 -1
  2. streamlit/components/v1/custom_component.py +1 -1
  3. streamlit/config.py +16 -2
  4. streamlit/delta_generator.py +0 -3
  5. streamlit/deprecation_util.py +1 -1
  6. streamlit/elements/arrow.py +1 -1
  7. streamlit/elements/code.py +15 -0
  8. streamlit/elements/deck_gl_json_chart.py +1 -1
  9. streamlit/elements/doc_string.py +18 -26
  10. streamlit/elements/lib/built_in_chart_utils.py +8 -8
  11. streamlit/elements/lib/column_config_utils.py +1 -1
  12. streamlit/elements/lib/column_types.py +3 -0
  13. streamlit/elements/lib/image_utils.py +7 -7
  14. streamlit/elements/lib/pandas_styler_utils.py +7 -7
  15. streamlit/elements/map.py +1 -1
  16. streamlit/elements/plotly_chart.py +1 -1
  17. streamlit/elements/vega_charts.py +7 -7
  18. streamlit/elements/widgets/audio_input.py +1 -1
  19. streamlit/elements/widgets/button.py +1 -1
  20. streamlit/elements/widgets/button_group.py +5 -11
  21. streamlit/elements/widgets/camera_input.py +1 -1
  22. streamlit/elements/widgets/chat.py +1 -3
  23. streamlit/elements/widgets/checkbox.py +1 -1
  24. streamlit/elements/widgets/color_picker.py +1 -1
  25. streamlit/elements/widgets/data_editor.py +1 -1
  26. streamlit/elements/widgets/file_uploader.py +1 -3
  27. streamlit/elements/widgets/multiselect.py +1 -5
  28. streamlit/elements/widgets/number_input.py +1 -3
  29. streamlit/elements/widgets/radio.py +1 -5
  30. streamlit/elements/widgets/select_slider.py +3 -7
  31. streamlit/elements/widgets/selectbox.py +1 -5
  32. streamlit/elements/widgets/slider.py +1 -1
  33. streamlit/elements/widgets/text_widgets.py +2 -2
  34. streamlit/elements/widgets/time_widgets.py +2 -6
  35. streamlit/external/langchain/streamlit_callback_handler.py +4 -0
  36. streamlit/git_util.py +2 -2
  37. streamlit/hello/dataframe_demo.py +2 -2
  38. streamlit/navigation/page.py +1 -1
  39. streamlit/proto/Code_pb2.py +4 -3
  40. streamlit/proto/Code_pb2.pyi +9 -1
  41. streamlit/runtime/caching/cached_message_replay.py +1 -1
  42. streamlit/runtime/caching/legacy_cache_api.py +1 -1
  43. streamlit/runtime/caching/storage/dummy_cache_storage.py +1 -1
  44. streamlit/runtime/forward_msg_queue.py +8 -8
  45. streamlit/runtime/pages_manager.py +1 -3
  46. streamlit/runtime/scriptrunner/exec_code.py +1 -1
  47. streamlit/runtime/scriptrunner/magic.py +3 -4
  48. streamlit/runtime/scriptrunner/script_runner.py +2 -2
  49. streamlit/runtime/state/common.py +2 -2
  50. streamlit/runtime/state/session_state.py +2 -2
  51. streamlit/static/index.html +1 -1
  52. streamlit/static/static/js/{ErrorOutline.esm.BGxEEkBO.js → ErrorOutline.esm.BXGjCB7E.js} +1 -1
  53. streamlit/static/static/js/{FileDownload.esm.BIvOCWXm.js → FileDownload.esm.sOCqSnDy.js} +1 -1
  54. streamlit/static/static/js/{FileHelper.CJg2rGQf.js → FileHelper.DuN7B5ko.js} +1 -1
  55. streamlit/static/static/js/{FormClearHelper.BKO5MjJ1.js → FormClearHelper.mBqxy6fp.js} +1 -1
  56. streamlit/static/static/js/{Hooks.Ch4fyM-d.js → Hooks.B8RCaOU-.js} +1 -1
  57. streamlit/static/static/js/{InputInstructions.BVG0uTsn.js → InputInstructions.CgQJAdmY.js} +1 -1
  58. streamlit/static/static/js/{ProgressBar.qtOeZiGm.js → ProgressBar.o46iipVl.js} +1 -1
  59. streamlit/static/static/js/{RenderInPortalIfExists.BNrfjgR-.js → RenderInPortalIfExists.CZifGklq.js} +1 -1
  60. streamlit/static/static/js/{Toolbar.DLYoM1Wd.js → Toolbar.CKRoYZWM.js} +1 -1
  61. streamlit/static/static/js/{base-input.CMZL3Njp.js → base-input.Me5gYF5B.js} +1 -1
  62. streamlit/static/static/js/{checkbox.Bg2c6brb.js → checkbox.CWWogItI.js} +1 -1
  63. streamlit/static/static/js/{createSuper.feapqlxC.js → createSuper.Bsmy7vnu.js} +1 -1
  64. streamlit/static/static/js/{data-grid-overlay-editor.CPfW2LFj.js → data-grid-overlay-editor.CgAv1I8N.js} +1 -1
  65. streamlit/static/static/js/{downloader.DzXny7Ld.js → downloader.BbuyvUmM.js} +1 -1
  66. streamlit/static/static/js/{es6.0m8Dphx5.js → es6.cFKClVYr.js} +2 -2
  67. streamlit/static/static/js/{iframeResizer.contentWindow.cmKtyqx-.js → iframeResizer.contentWindow.D00awOKx.js} +1 -1
  68. streamlit/static/static/js/{index.BvuI_MOQ.js → index.B0eFd777.js} +1 -1
  69. streamlit/static/static/js/{index.CaUiwEHb.js → index.B5KSWyCG.js} +1 -1
  70. streamlit/static/static/js/{index.CPBpuLNa.js → index.B6NqnBxa.js} +1 -1
  71. streamlit/static/static/js/{index.cslPh4fD.js → index.BKz9YyeL.js} +1 -1
  72. streamlit/static/static/js/{index.Cz5dPfTR.js → index.BMizE8Sq.js} +1 -1
  73. streamlit/static/static/js/{index.qG6NX4j3.js → index.BY-1pChC.js} +1 -1
  74. streamlit/static/static/js/{index.lC8LhcmX.js → index.B_FepcMP.js} +1 -1
  75. streamlit/static/static/js/{index.l2ZjmqZa.js → index.BfEtVe_N.js} +1 -1
  76. streamlit/static/static/js/{index.C4ApZ9VX.js → index.Bo5OoJ1E.js} +1 -1
  77. streamlit/static/static/js/{index.GK7AGRO0.js → index.BtCmnwwO.js} +1 -1
  78. streamlit/static/static/js/{index.C-FM6HWK.js → index.BtTvTjVr.js} +5 -5
  79. streamlit/static/static/js/{index.BOLpjodc.js → index.By8gv4Ay.js} +1 -1
  80. streamlit/static/static/js/{index.lmhSYtGE.js → index.C8S8FJep.js} +1 -1
  81. streamlit/static/static/js/{index.9ahYhn9L.js → index.CC6pozcl.js} +1 -1
  82. streamlit/static/static/js/{index.CoEs3Tyr.js → index.CEFfPwWA.js} +1 -1
  83. streamlit/static/static/js/{index.C9SZjgyE.js → index.CSZNuohX.js} +1 -1
  84. streamlit/static/static/js/{index.B1SRlRQI.js → index.CZT8t1KG.js} +1 -1
  85. streamlit/static/static/js/{index.CrKlAaBP.js → index.Cg3APxPS.js} +1 -1
  86. streamlit/static/static/js/{index.Cz-wSZKK.js → index.CtsvxUli.js} +1 -1
  87. streamlit/static/static/js/{index.Bml5MH48.js → index.D67skAdZ.js} +1 -1
  88. streamlit/static/static/js/{index.C51U-ytW.js → index.DUVjoXrp.js} +1 -1
  89. streamlit/static/static/js/{index.DYNcgXHh.js → index.DZSznc3f.js} +1 -1
  90. streamlit/static/static/js/{index.DZEEja3T.js → index.Db4G4s87.js} +1 -1
  91. streamlit/static/static/js/{index.BkUl8Uwz.js → index.DkQYsEGq.js} +39 -39
  92. streamlit/static/static/js/{index.CaDlXCxB.js → index.Dn4hsDID.js} +1 -1
  93. streamlit/static/static/js/{index.D75DmXmJ.js → index.DnnK1XX4.js} +1 -1
  94. streamlit/static/static/js/{index.Dc-nqnmm.js → index.GIpP3S4h.js} +1 -1
  95. streamlit/static/static/js/{index.NE3kJsno.js → index.HOc29Qsj.js} +1 -1
  96. streamlit/static/static/js/{index.DFJR7tFk.js → index.VrX7AJMW.js} +1 -1
  97. streamlit/static/static/js/{index.CeVeyA9j.js → index.ZMXLPc9m.js} +1 -1
  98. streamlit/static/static/js/{index.DXwLRPNi.js → index.Zbagu1xh.js} +1 -1
  99. streamlit/static/static/js/{index.BQdNrQcI.js → index.bliAXvPp.js} +1 -1
  100. streamlit/static/static/js/{index.Dj9pydGj.js → index.djYQBt-8.js} +1 -1
  101. streamlit/static/static/js/{index.45HlJMvy.js → index.eVt4urZS.js} +1 -1
  102. streamlit/static/static/js/{index.Br4Vls5z.js → index.ew1fqjzv.js} +1 -1
  103. streamlit/static/static/js/{index.T6zTT7so.js → index.v9S4U7E0.js} +1 -1
  104. streamlit/static/static/js/index.xsH4HHeE.js +6 -0
  105. streamlit/static/static/js/{index.8zBbwiSq.js → index.zbOUPreQ.js} +1 -1
  106. streamlit/static/static/js/{input.AzemsQR7.js → input.E-TEQSd2.js} +1 -1
  107. streamlit/static/static/js/{memory.BNnDm5qx.js → memory.C47SiSLX.js} +1 -1
  108. streamlit/static/static/js/{mergeWith.CnAe-pY8.js → mergeWith.CuOPq9Xx.js} +1 -1
  109. streamlit/static/static/js/{number-overlay-editor.CoO3Xzpl.js → number-overlay-editor.oJywx_AR.js} +1 -1
  110. streamlit/static/static/js/{possibleConstructorReturn.-4k2karl.js → possibleConstructorReturn.DezSYWQP.js} +1 -1
  111. streamlit/static/static/js/{sandbox.B_lhrPSt.js → sandbox.CpLGEYsx.js} +1 -1
  112. streamlit/static/static/js/{textarea.BXroYkeL.js → textarea.CF2OGnSF.js} +1 -1
  113. streamlit/static/static/js/{timepicker.mhMg0du0.js → timepicker.CckJhoGD.js} +1 -1
  114. streamlit/static/static/js/{toConsumableArray.xDE9XBoI.js → toConsumableArray.DrtLgJ_5.js} +1 -1
  115. streamlit/static/static/js/{uniqueId.DPZFapqq.js → uniqueId.kgGoKER7.js} +1 -1
  116. streamlit/static/static/js/{useBasicWidgetState.DWXpUITX.js → useBasicWidgetState.CHBqT0_O.js} +1 -1
  117. streamlit/static/static/js/{useOnInputChange.FMGxl8Ty.js → useOnInputChange.A8V2n4e2.js} +1 -1
  118. streamlit/static/static/js/{withFullScreenWrapper.cCJx5Did.js → withFullScreenWrapper.Bh5OZGIu.js} +1 -1
  119. streamlit/type_util.py +2 -2
  120. streamlit/watcher/event_based_path_watcher.py +14 -0
  121. streamlit/watcher/local_sources_watcher.py +43 -7
  122. streamlit/web/bootstrap.py +3 -3
  123. streamlit/web/cli.py +4 -4
  124. streamlit/web/server/media_file_handler.py +2 -2
  125. {streamlit_nightly-1.44.2.dev20250427.dist-info → streamlit_nightly-1.44.2.dev20250428.dist-info}/METADATA +1 -1
  126. {streamlit_nightly-1.44.2.dev20250427.dist-info → streamlit_nightly-1.44.2.dev20250428.dist-info}/RECORD +130 -130
  127. streamlit/static/static/js/index.t--hEgTQ.js +0 -6
  128. {streamlit_nightly-1.44.2.dev20250427.data → streamlit_nightly-1.44.2.dev20250428.data}/scripts/streamlit.cmd +0 -0
  129. {streamlit_nightly-1.44.2.dev20250427.dist-info → streamlit_nightly-1.44.2.dev20250428.dist-info}/WHEEL +0 -0
  130. {streamlit_nightly-1.44.2.dev20250427.dist-info → streamlit_nightly-1.44.2.dev20250428.dist-info}/entry_points.txt +0 -0
  131. {streamlit_nightly-1.44.2.dev20250427.dist-info → streamlit_nightly-1.44.2.dev20250428.dist-info}/top_level.txt +0 -0
@@ -263,7 +263,7 @@ class _DateInputValues:
263
263
  class TimeInputSerde:
264
264
  value: time | None
265
265
 
266
- def deserialize(self, ui_value: str | None, widget_id: Any = "") -> time | None:
266
+ def deserialize(self, ui_value: str | None) -> time | None:
267
267
  return (
268
268
  datetime.strptime(ui_value, "%H:%M").time()
269
269
  if ui_value is not None
@@ -282,11 +282,7 @@ class TimeInputSerde:
282
282
  class DateInputSerde:
283
283
  value: _DateInputValues
284
284
 
285
- def deserialize(
286
- self,
287
- ui_value: Any,
288
- widget_id: str = "",
289
- ) -> DateWidgetReturn:
285
+ def deserialize(self, ui_value: Any) -> DateWidgetReturn:
290
286
  return_value: Sequence[date] | None
291
287
  if ui_value is not None:
292
288
  return_value = tuple(
@@ -36,6 +36,10 @@ This module is lazy-loaded.
36
36
  # by default.
37
37
  # mypy: disable-error-code="import-not-found, unused-ignore, misc"
38
38
 
39
+ # Deactivate unused argument errors for this file since we need lots of
40
+ # unused arguments to comply with the LangChain callback interface.
41
+ # ruff: noqa: ARG002
42
+
39
43
  from __future__ import annotations
40
44
 
41
45
  import time
streamlit/git_util.py CHANGED
@@ -32,8 +32,8 @@ MIN_GIT_VERSION = (2, 7, 0)
32
32
 
33
33
  class GitRepo:
34
34
  def __init__(self, path):
35
- # If we have a valid repo, git_version will be a tuple of 3+ ints:
36
- # (major, minor, patch, possible_additional_patch_number)
35
+ # If we have a valid repo, git_version will be a tuple
36
+ # of 3+ ints: (major, minor, patch, possible_additional_patch_number)
37
37
  self.git_version: tuple[int, ...] | None = None
38
38
 
39
39
  try:
@@ -23,13 +23,13 @@ from streamlit.hello.utils import show_code
23
23
 
24
24
  def data_frame_demo():
25
25
  @st.cache_data
26
- def get_UN_data():
26
+ def get_un_data():
27
27
  AWS_BUCKET_URL = "https://streamlit-demo-data.s3-us-west-2.amazonaws.com"
28
28
  df = pd.read_csv(AWS_BUCKET_URL + "/agri.csv.gz")
29
29
  return df.set_index("Region")
30
30
 
31
31
  try:
32
- df = get_UN_data()
32
+ df = get_un_data()
33
33
  countries = st.multiselect(
34
34
  "Choose countries", list(df.index), ["China", "United States of America"]
35
35
  )
@@ -27,7 +27,7 @@ from streamlit.util import calc_md5
27
27
 
28
28
 
29
29
  @gather_metrics("Page")
30
- def Page(
30
+ def Page( # noqa: N802
31
31
  page: str | Path | Callable[[], None],
32
32
  *,
33
33
  title: str | None = None,
@@ -12,9 +12,10 @@ from google.protobuf.internal import builder as _builder
12
12
  _sym_db = _symbol_database.Default()
13
13
 
14
14
 
15
+ from streamlit.proto import WidthConfig_pb2 as streamlit_dot_proto_dot_WidthConfig__pb2
15
16
 
16
17
 
17
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1astreamlit/proto/Code.proto\"j\n\x04\x43ode\x12\x11\n\tcode_text\x18\x01 \x01(\t\x12\x10\n\x08language\x18\x02 \x01(\t\x12\x19\n\x11show_line_numbers\x18\x03 \x01(\x08\x12\x12\n\nwrap_lines\x18\x04 \x01(\x08\x12\x0e\n\x06height\x18\x05 \x01(\rB)\n\x1c\x63om.snowflake.apps.streamlitB\tCodeProtob\x06proto3')
18
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1astreamlit/proto/Code.proto\x1a!streamlit/proto/WidthConfig.proto\"\x98\x01\n\x04\x43ode\x12\x11\n\tcode_text\x18\x01 \x01(\t\x12\x10\n\x08language\x18\x02 \x01(\t\x12\x19\n\x11show_line_numbers\x18\x03 \x01(\x08\x12\x12\n\nwrap_lines\x18\x04 \x01(\x08\x12\x0e\n\x06height\x18\x05 \x01(\r\x12,\n\x0cwidth_config\x18\x06 \x01(\x0b\x32\x16.streamlit.WidthConfigB)\n\x1c\x63om.snowflake.apps.streamlitB\tCodeProtob\x06proto3')
18
19
 
19
20
  _globals = globals()
20
21
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -22,6 +23,6 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.Code_pb2',
22
23
  if not _descriptor._USE_C_DESCRIPTORS:
23
24
  _globals['DESCRIPTOR']._loaded_options = None
24
25
  _globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\tCodeProto'
25
- _globals['_CODE']._serialized_start=30
26
- _globals['_CODE']._serialized_end=136
26
+ _globals['_CODE']._serialized_start=66
27
+ _globals['_CODE']._serialized_end=218
27
28
  # @@protoc_insertion_point(module_scope)
@@ -20,6 +20,7 @@ limitations under the License.
20
20
  import builtins
21
21
  import google.protobuf.descriptor
22
22
  import google.protobuf.message
23
+ import streamlit.proto.WidthConfig_pb2
23
24
  import typing
24
25
 
25
26
  DESCRIPTOR: google.protobuf.descriptor.FileDescriptor
@@ -35,12 +36,17 @@ class Code(google.protobuf.message.Message):
35
36
  SHOW_LINE_NUMBERS_FIELD_NUMBER: builtins.int
36
37
  WRAP_LINES_FIELD_NUMBER: builtins.int
37
38
  HEIGHT_FIELD_NUMBER: builtins.int
39
+ WIDTH_CONFIG_FIELD_NUMBER: builtins.int
38
40
  code_text: builtins.str
39
41
  """Content to display."""
40
42
  language: builtins.str
41
43
  show_line_numbers: builtins.bool
42
44
  wrap_lines: builtins.bool
43
45
  height: builtins.int
46
+ @property
47
+ def width_config(self) -> streamlit.proto.WidthConfig_pb2.WidthConfig:
48
+ """Width configuration"""
49
+
44
50
  def __init__(
45
51
  self,
46
52
  *,
@@ -49,7 +55,9 @@ class Code(google.protobuf.message.Message):
49
55
  show_line_numbers: builtins.bool = ...,
50
56
  wrap_lines: builtins.bool = ...,
51
57
  height: builtins.int = ...,
58
+ width_config: streamlit.proto.WidthConfig_pb2.WidthConfig | None = ...,
52
59
  ) -> None: ...
53
- def ClearField(self, field_name: typing.Literal["code_text", b"code_text", "height", b"height", "language", b"language", "show_line_numbers", b"show_line_numbers", "wrap_lines", b"wrap_lines"]) -> None: ...
60
+ def HasField(self, field_name: typing.Literal["width_config", b"width_config"]) -> builtins.bool: ...
61
+ def ClearField(self, field_name: typing.Literal["code_text", b"code_text", "height", b"height", "language", b"language", "show_line_numbers", b"show_line_numbers", "width_config", b"width_config", "wrap_lines", b"wrap_lines"]) -> None: ...
54
62
 
55
63
  global___Code = Code
@@ -132,7 +132,7 @@ class CachedMessageReplayContext(threading.local):
132
132
  return util.repr_(self)
133
133
 
134
134
  @contextlib.contextmanager
135
- def calling_cached_function(self, func: FunctionType) -> Iterator[None]:
135
+ def calling_cached_function(self, func: FunctionType) -> Iterator[None]: # noqa: ARG002
136
136
  """Context manager that should wrap the invocation of a cached function.
137
137
  It allows us to track any `st.foo` messages that are generated from inside the
138
138
  function for playback during cache retrieval.
@@ -36,7 +36,7 @@ def cache(
36
36
  persist: bool = False,
37
37
  allow_output_mutation: bool = False,
38
38
  show_spinner: bool = True,
39
- suppress_st_warning: bool = False,
39
+ suppress_st_warning: bool = False, # noqa: ARG001
40
40
  hash_funcs: HashFuncsDict | None = None,
41
41
  max_entries: int | None = None,
42
42
  ttl: float | None = None,
@@ -40,7 +40,7 @@ class MemoryCacheStorageManager(CacheStorageManager):
40
40
 
41
41
 
42
42
  class DummyCacheStorage(CacheStorage):
43
- def get(self, key: str) -> bytes:
43
+ def get(self, key: str) -> bytes: # noqa: ARG002
44
44
  """
45
45
  Dummy gets the value for a given key,
46
46
  always raises an CacheStorageKeyNotFoundError.
@@ -82,13 +82,13 @@ class ForwardMsgQueue:
82
82
  # since the queue can be flushed to the browser at any time.
83
83
  # For example:
84
84
  # queue 1:
85
- # empty [0, 0] <- skipped
86
- # markdown [0, 0]
87
- # empty [1, 0] <- send to frontend
85
+ # > empty [0, 0] <- skipped
86
+ # > markdown [0, 0]
87
+ # > empty [1, 0] <- send to frontend
88
88
  #
89
89
  # queue 2:
90
- # markdown [1, 0]
91
- # ...
90
+ # > markdown [1, 0]
91
+ # > ...
92
92
 
93
93
  delta_key = tuple(msg.metadata.delta_path)
94
94
  if delta_key in self._delta_index_map:
@@ -204,9 +204,9 @@ def _maybe_compose_delta_msgs(
204
204
  # We never replace add_block deltas, because blocks can have
205
205
  # other dependent deltas later in the queue. For example:
206
206
  #
207
- # placeholder = st.empty()
208
- # placeholder.columns(1)
209
- # placeholder.empty()
207
+ # > placeholder = st.empty()
208
+ # > placeholder.columns(1)
209
+ # > placeholder.empty()
210
210
  #
211
211
  # The call to "placeholder.columns(1)" creates two blocks, a parent
212
212
  # container with delta_path (0, 0), and a column child with
@@ -99,9 +99,7 @@ class PagesManager:
99
99
  self._intended_page_script_hash = page_script_hash
100
100
  self._intended_page_name = page_name
101
101
 
102
- def get_initial_active_script(
103
- self, page_script_hash: PageHash, page_name: PageName
104
- ) -> PageInfo | None:
102
+ def get_initial_active_script(self, page_script_hash: PageHash) -> PageInfo | None:
105
103
  return {
106
104
  # We always run the main script in V2 as it's the common code
107
105
  "script_path": self.main_script_path,
@@ -34,7 +34,7 @@ if TYPE_CHECKING:
34
34
  from streamlit.runtime.scriptrunner_utils.script_run_context import ScriptRunContext
35
35
 
36
36
 
37
- class modified_sys_path:
37
+ class modified_sys_path: # noqa: N801
38
38
  """A context for prepending a directory to sys.path for a second.
39
39
 
40
40
  Code inspired by IPython:
@@ -21,8 +21,7 @@ from typing import Any, Final
21
21
  from streamlit import config
22
22
 
23
23
  # When a Streamlit app is magicified, we insert a `magic_funcs` import near the top of
24
- # its module's AST:
25
- # import streamlit.runtime.scriptrunner.magic_funcs as __streamlitmagic__
24
+ # its module's AST: import streamlit.runtime.scriptrunner.magic_funcs as __streamlitmagic__
26
25
  MAGIC_MODULE_NAME: Final = "__streamlitmagic__"
27
26
 
28
27
 
@@ -217,8 +216,8 @@ def _get_st_write_from_expr(
217
216
  return None
218
217
 
219
218
  # If tuple, call st.write(*the_tuple). This allows us to add a comma at the end of a
220
- # statement to turn it into an expression that should be st-written. Ex:
221
- # "np.random.randn(1000, 2),"
219
+ # statement to turn it into an expression that should be
220
+ # st-written. Ex: "np.random.randn(1000, 2),"
222
221
  args = node.value.elts if type(node.value) is ast.Tuple else [node.value]
223
222
  return _build_st_write_call(args)
224
223
 
@@ -265,7 +265,7 @@ class ScriptRunner:
265
265
  # _maybe_handle_execution_control_request.
266
266
  self._execing = False
267
267
 
268
- # This is initialized in start()
268
+ # This is initialized in the start() method
269
269
  self._script_thread: threading.Thread | None = None
270
270
 
271
271
  def __repr__(self) -> str:
@@ -484,7 +484,7 @@ class ScriptRunner:
484
484
  rerun_data.page_script_hash, rerun_data.page_name
485
485
  )
486
486
  active_script = self._pages_manager.get_initial_active_script(
487
- rerun_data.page_script_hash, rerun_data.page_name
487
+ rerun_data.page_script_hash
488
488
  )
489
489
  main_page_info = self._pages_manager.get_main_page()
490
490
 
@@ -51,7 +51,7 @@ WidgetCallback: TypeAlias = Callable[..., None]
51
51
  # WidgetState proto, and returns a regular python value. A serializer
52
52
  # receives a regular python value, and returns something suitable for
53
53
  # a value field on WidgetState proto. They should be inverses.
54
- WidgetDeserializer: TypeAlias = Callable[[Any, str], T]
54
+ WidgetDeserializer: TypeAlias = Callable[[Any], T]
55
55
  WidgetSerializer: TypeAlias = Callable[[T], Any]
56
56
 
57
57
  # The array value field names are part of the larger set of possible value
@@ -156,7 +156,7 @@ class RegisterWidgetResult(Generic[T_co]):
156
156
  """The canonical way to construct a RegisterWidgetResult in cases
157
157
  where the true widget value could not be determined.
158
158
  """
159
- return cls(value=deserializer(None, ""), value_changed=False)
159
+ return cls(value=deserializer(None), value_changed=False)
160
160
 
161
161
 
162
162
  def user_key_from_element_id(element_id: str) -> str | None:
@@ -125,7 +125,7 @@ class WStates(MutableMapping[str, Any]):
125
125
  elif value_field_name == "json_value":
126
126
  value = json.loads(value)
127
127
 
128
- deserialized = metadata.deserializer(value, metadata.id)
128
+ deserialized = metadata.deserializer(value)
129
129
 
130
130
  # Update metadata to reflect information from WidgetState proto
131
131
  self.set_widget_metadata(
@@ -683,7 +683,7 @@ class SessionState:
683
683
  # This is the first time the widget is registered, so we save its
684
684
  # value in widget state.
685
685
  deserializer = metadata.deserializer
686
- initial_widget_value = deepcopy(deserializer(None, metadata.id))
686
+ initial_widget_value = deepcopy(deserializer(None))
687
687
  self._new_widget_state.set_from_value(widget_id, initial_widget_value)
688
688
 
689
689
  # Get the current value of the widget for use as its return value.
@@ -51,7 +51,7 @@
51
51
  <script>
52
52
  window.prerenderReady = false
53
53
  </script>
54
- <script type="module" crossorigin src="./static/js/index.BkUl8Uwz.js"></script>
54
+ <script type="module" crossorigin src="./static/js/index.DkQYsEGq.js"></script>
55
55
  <link rel="stylesheet" crossorigin href="./static/css/index.C6rq3aMZ.css">
56
56
  </head>
57
57
  <body>
@@ -1 +1 @@
1
- import{r,E as a,_ as n}from"./index.BkUl8Uwz.js";var i=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(a,n({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});i.displayName="ErrorOutline";export{i as E};
1
+ import{r,E as a,_ as n}from"./index.DkQYsEGq.js";var i=r.forwardRef(function(e,t){var o={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return r.createElement(a,n({iconAttrs:o,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},e,{ref:t}),r.createElement("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))});i.displayName="ErrorOutline";export{i as E};
@@ -1 +1 @@
1
- import{r as e,E as n,_ as a}from"./index.BkUl8Uwz.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};
1
+ import{r as e,E as n,_ as a}from"./index.DkQYsEGq.js";var o=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),e.createElement("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}))});o.displayName="Delete";var i=e.forwardRef(function(t,r){var l={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return e.createElement(n,a({iconAttrs:l,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:r}),e.createElement("rect",{width:24,height:24,fill:"none"}),e.createElement("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4l-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}))});i.displayName="FileDownload";export{o as D,i as F};