streamlit-nightly 1.35.1.dev20240610__py2.py3-none-any.whl → 1.35.1.dev20240612__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamlit/__init__.py +5 -1
- streamlit/case_converters.py +2 -2
- streamlit/cli_util.py +2 -2
- streamlit/color_util.py +2 -2
- streamlit/commands/experimental_query_params.py +6 -8
- streamlit/commands/logo.py +4 -9
- streamlit/commands/navigation.py +6 -4
- streamlit/components/lib/local_component_registry.py +4 -2
- streamlit/components/types/base_component_registry.py +3 -2
- streamlit/components/v1/component_arrow.py +2 -1
- streamlit/components/v1/component_registry.py +6 -2
- streamlit/components/v1/components.py +4 -2
- streamlit/components/v1/custom_component.py +6 -6
- streamlit/config.py +15 -12
- streamlit/connections/snowflake_connection.py +2 -1
- streamlit/connections/snowpark_connection.py +2 -4
- streamlit/connections/sql_connection.py +2 -1
- streamlit/delta_generator.py +3 -4
- streamlit/elements/arrow.py +3 -6
- streamlit/elements/code.py +1 -1
- streamlit/elements/dialog_decorator.py +10 -8
- streamlit/elements/doc_string.py +1 -1
- streamlit/elements/exception.py +1 -1
- streamlit/elements/form.py +1 -1
- streamlit/elements/heading.py +1 -1
- streamlit/elements/html.py +1 -1
- streamlit/elements/image.py +5 -3
- streamlit/elements/layouts.py +36 -13
- streamlit/elements/lib/built_in_chart_utils.py +24 -12
- streamlit/elements/lib/column_config_utils.py +2 -1
- streamlit/elements/lib/dialog.py +8 -5
- streamlit/elements/lib/dicttools.py +3 -3
- streamlit/elements/lib/mutable_status_container.py +8 -5
- streamlit/elements/lib/pandas_styler_utils.py +2 -1
- streamlit/elements/lib/subtitle_utils.py +0 -1
- streamlit/elements/lib/utils.py +8 -10
- streamlit/elements/plotly_chart.py +5 -10
- streamlit/elements/pyplot.py +0 -1
- streamlit/elements/toast.py +2 -2
- streamlit/elements/vega_charts.py +46 -10
- streamlit/elements/widgets/color_picker.py +6 -4
- streamlit/elements/widgets/file_uploader.py +4 -8
- streamlit/elements/widgets/multiselect.py +2 -4
- streamlit/elements/widgets/number_input.py +4 -8
- streamlit/elements/widgets/select_slider.py +1 -1
- streamlit/elements/widgets/slider.py +2 -5
- streamlit/elements/widgets/time_widgets.py +5 -5
- streamlit/errors.py +1 -6
- streamlit/git_util.py +2 -2
- streamlit/hello/Animation_Demo.py +0 -1
- streamlit/logger.py +1 -1
- streamlit/navigation/page.py +6 -1
- streamlit/net_util.py +2 -5
- streamlit/proto/AutoRerun_pb2.py +3 -2
- streamlit/proto/Block_pb2.py +24 -22
- streamlit/proto/Block_pb2.pyi +19 -1
- streamlit/runtime/app_session.py +7 -7
- streamlit/runtime/caching/__init__.py +9 -13
- streamlit/runtime/caching/cache_data_api.py +18 -7
- streamlit/runtime/caching/cache_errors.py +8 -6
- streamlit/runtime/caching/cache_resource_api.py +10 -9
- streamlit/runtime/caching/cache_utils.py +10 -7
- streamlit/runtime/caching/cached_message_replay.py +10 -9
- streamlit/runtime/caching/hashing.py +3 -3
- streamlit/runtime/caching/storage/cache_storage_protocol.py +1 -1
- streamlit/runtime/connection_factory.py +4 -2
- streamlit/runtime/credentials.py +11 -20
- streamlit/runtime/forward_msg_cache.py +10 -11
- streamlit/runtime/forward_msg_queue.py +6 -4
- streamlit/runtime/fragment.py +7 -9
- streamlit/runtime/media_file_manager.py +4 -4
- streamlit/runtime/memory_media_file_storage.py +7 -8
- streamlit/runtime/metrics_util.py +2 -4
- streamlit/runtime/pages_manager.py +41 -41
- streamlit/runtime/runtime.py +4 -4
- streamlit/runtime/runtime_util.py +7 -12
- streamlit/runtime/scriptrunner/magic.py +1 -1
- streamlit/runtime/scriptrunner/script_requests.py +4 -2
- streamlit/runtime/scriptrunner/script_run_context.py +15 -15
- streamlit/runtime/scriptrunner/script_runner.py +8 -8
- streamlit/runtime/secrets.py +3 -5
- streamlit/runtime/session_manager.py +8 -7
- streamlit/runtime/state/common.py +1 -1
- streamlit/runtime/state/query_params_proxy.py +5 -10
- streamlit/runtime/state/safe_session_state.py +8 -7
- streamlit/runtime/state/widgets.py +27 -27
- streamlit/runtime/stats.py +1 -1
- streamlit/runtime/uploaded_file_manager.py +4 -2
- streamlit/runtime/websocket_session_manager.py +6 -4
- streamlit/static/asset-manifest.json +3 -3
- streamlit/static/index.html +1 -1
- streamlit/static/static/js/{8492.8ad745d1.chunk.js → 4335.b492cdb7.chunk.js} +1 -1
- streamlit/static/static/js/main.0ebf040e.js +2 -0
- streamlit/string_util.py +1 -1
- streamlit/testing/v1/app_test.py +4 -2
- streamlit/testing/v1/element_tree.py +33 -37
- streamlit/testing/v1/local_script_runner.py +7 -7
- streamlit/time_util.py +2 -4
- streamlit/type_util.py +16 -29
- streamlit/user_info.py +4 -2
- streamlit/util.py +1 -1
- streamlit/watcher/event_based_path_watcher.py +6 -3
- streamlit/watcher/local_sources_watcher.py +11 -7
- streamlit/web/bootstrap.py +1 -1
- streamlit/web/cache_storage_manager_config.py +5 -1
- streamlit/web/cli.py +9 -4
- streamlit/web/server/browser_websocket_handler.py +7 -8
- streamlit/web/server/component_request_handler.py +4 -2
- streamlit/web/server/routes.py +3 -3
- streamlit/web/server/server.py +12 -12
- streamlit/web/server/server_util.py +5 -6
- streamlit/web/server/stats_request_handler.py +1 -1
- streamlit/web/server/upload_file_request_handler.py +5 -3
- {streamlit_nightly-1.35.1.dev20240610.dist-info → streamlit_nightly-1.35.1.dev20240612.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.35.1.dev20240610.dist-info → streamlit_nightly-1.35.1.dev20240612.dist-info}/RECORD +120 -120
- streamlit/static/static/js/main.dc75074b.js +0 -2
- /streamlit/static/static/js/{main.dc75074b.js.LICENSE.txt → main.0ebf040e.js.LICENSE.txt} +0 -0
- {streamlit_nightly-1.35.1.dev20240610.data → streamlit_nightly-1.35.1.dev20240612.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.35.1.dev20240610.dist-info → streamlit_nightly-1.35.1.dev20240612.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.35.1.dev20240610.dist-info → streamlit_nightly-1.35.1.dev20240612.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.35.1.dev20240610.dist-info → streamlit_nightly-1.35.1.dev20240612.dist-info}/top_level.txt +0 -0
@@ -450,7 +450,7 @@ def _parse_selection_mode(
|
|
450
450
|
|
451
451
|
if selection_mode is None:
|
452
452
|
# Activate all selection parameters:
|
453
|
-
return sorted(
|
453
|
+
return sorted(all_selection_params)
|
454
454
|
|
455
455
|
if isinstance(selection_mode, str):
|
456
456
|
# Convert single string to list:
|
@@ -463,7 +463,7 @@ def _parse_selection_mode(
|
|
463
463
|
f"Selection parameter '{selection_name}' is not defined in the chart spec. "
|
464
464
|
f"Available selection parameters are: {all_selection_params}."
|
465
465
|
)
|
466
|
-
return sorted(
|
466
|
+
return sorted(selection_mode)
|
467
467
|
|
468
468
|
|
469
469
|
def _reset_counter_pattern(prefix: str, vega_spec: str) -> str:
|
@@ -565,6 +565,8 @@ class VegaChartsMixin:
|
|
565
565
|
*,
|
566
566
|
x: str | None = None,
|
567
567
|
y: str | Sequence[str] | None = None,
|
568
|
+
x_label: str | None = None,
|
569
|
+
y_label: str | None = None,
|
568
570
|
color: str | Color | list[Color] | None = None,
|
569
571
|
width: int | None = None,
|
570
572
|
height: int | None = None,
|
@@ -594,6 +596,12 @@ class VegaChartsMixin:
|
|
594
596
|
table into a long-format table behind the scenes. If None, draws
|
595
597
|
the data of all remaining columns as data series.
|
596
598
|
|
599
|
+
x_label : str or None
|
600
|
+
The label for the x-axis. If None, either the column name specified in x will be used, or no label will be displayed.
|
601
|
+
|
602
|
+
y_label : str or None
|
603
|
+
The label for the y-axis. If None, either the column name specified in y will be used, or no label will be displayed.
|
604
|
+
|
597
605
|
color : str, tuple, Sequence of str, Sequence of tuple, or None
|
598
606
|
The color to use for different lines in this chart.
|
599
607
|
|
@@ -717,6 +725,8 @@ class VegaChartsMixin:
|
|
717
725
|
data=data,
|
718
726
|
x_from_user=x,
|
719
727
|
y_from_user=y,
|
728
|
+
x_axis_label=x_label,
|
729
|
+
y_axis_label=y_label,
|
720
730
|
color_from_user=color,
|
721
731
|
size_from_user=None,
|
722
732
|
width=width,
|
@@ -739,6 +749,8 @@ class VegaChartsMixin:
|
|
739
749
|
*,
|
740
750
|
x: str | None = None,
|
741
751
|
y: str | Sequence[str] | None = None,
|
752
|
+
x_label: str | None = None,
|
753
|
+
y_label: str | None = None,
|
742
754
|
color: str | Color | list[Color] | None = None,
|
743
755
|
width: int | None = None,
|
744
756
|
height: int | None = None,
|
@@ -768,6 +780,12 @@ class VegaChartsMixin:
|
|
768
780
|
table into a long-format table behind the scenes. If None, draws
|
769
781
|
the data of all remaining columns as data series.
|
770
782
|
|
783
|
+
x_label : str or None
|
784
|
+
The label for the x-axis. If None, either the column name specified in x will be used, or no label will be displayed.
|
785
|
+
|
786
|
+
y_label : str or None
|
787
|
+
The label for the y-axis. If None, either the column name specified in y will be used, or no label will be displayed.
|
788
|
+
|
771
789
|
color : str, tuple, Sequence of str, Sequence of tuple, or None
|
772
790
|
The color to use for different series in this chart.
|
773
791
|
|
@@ -891,6 +909,8 @@ class VegaChartsMixin:
|
|
891
909
|
data=data,
|
892
910
|
x_from_user=x,
|
893
911
|
y_from_user=y,
|
912
|
+
x_axis_label=x_label,
|
913
|
+
y_axis_label=y_label,
|
894
914
|
color_from_user=color,
|
895
915
|
size_from_user=None,
|
896
916
|
width=width,
|
@@ -913,6 +933,8 @@ class VegaChartsMixin:
|
|
913
933
|
*,
|
914
934
|
x: str | None = None,
|
915
935
|
y: str | Sequence[str] | None = None,
|
936
|
+
x_label: str | None = None,
|
937
|
+
y_label: str | None = None,
|
916
938
|
color: str | Color | list[Color] | None = None,
|
917
939
|
width: int | None = None,
|
918
940
|
height: int | None = None,
|
@@ -942,6 +964,12 @@ class VegaChartsMixin:
|
|
942
964
|
table into a long-format table behind the scenes. If None, draws
|
943
965
|
the data of all remaining columns as data series.
|
944
966
|
|
967
|
+
x_label : str or None
|
968
|
+
The label for the x-axis. If None, either the column name specified in x will be used, or no label will be displayed.
|
969
|
+
|
970
|
+
y_label : str or None
|
971
|
+
The label for the y-axis. If None, either the column name specified in y will be used, or no label will be displayed.
|
972
|
+
|
945
973
|
color : str, tuple, Sequence of str, Sequence of tuple, or None
|
946
974
|
The color to use for different series in this chart.
|
947
975
|
|
@@ -1067,6 +1095,8 @@ class VegaChartsMixin:
|
|
1067
1095
|
data=data,
|
1068
1096
|
x_from_user=x,
|
1069
1097
|
y_from_user=y,
|
1098
|
+
x_axis_label=x_label,
|
1099
|
+
y_axis_label=y_label,
|
1070
1100
|
color_from_user=color,
|
1071
1101
|
size_from_user=None,
|
1072
1102
|
width=width,
|
@@ -1089,6 +1119,8 @@ class VegaChartsMixin:
|
|
1089
1119
|
*,
|
1090
1120
|
x: str | None = None,
|
1091
1121
|
y: str | Sequence[str] | None = None,
|
1122
|
+
x_label: str | None = None,
|
1123
|
+
y_label: str | None = None,
|
1092
1124
|
color: str | Color | list[Color] | None = None,
|
1093
1125
|
size: str | float | int | None = None,
|
1094
1126
|
width: int | None = None,
|
@@ -1119,6 +1151,12 @@ class VegaChartsMixin:
|
|
1119
1151
|
table into a long-format table behind the scenes. If None, draws
|
1120
1152
|
the data of all remaining columns as data series.
|
1121
1153
|
|
1154
|
+
x_label : str or None
|
1155
|
+
The label for the x-axis. If None, either the column name specified in x will be used, or no label will be displayed.
|
1156
|
+
|
1157
|
+
y_label : str or None
|
1158
|
+
The label for the y-axis. If None, either the column name specified in y will be used, or no label will be displayed.
|
1159
|
+
|
1122
1160
|
color : str, tuple, Sequence of str, Sequence of tuple, or None
|
1123
1161
|
The color of the circles representing each datapoint.
|
1124
1162
|
|
@@ -1256,6 +1294,8 @@ class VegaChartsMixin:
|
|
1256
1294
|
data=data,
|
1257
1295
|
x_from_user=x,
|
1258
1296
|
y_from_user=y,
|
1297
|
+
x_axis_label=x_label,
|
1298
|
+
y_axis_label=y_label,
|
1259
1299
|
color_from_user=color,
|
1260
1300
|
size_from_user=size,
|
1261
1301
|
width=width,
|
@@ -1281,8 +1321,7 @@ class VegaChartsMixin:
|
|
1281
1321
|
key: Key | None = None,
|
1282
1322
|
on_select: Literal["ignore"], # No default value here to make it work with mypy
|
1283
1323
|
selection_mode: str | Iterable[str] | None = None,
|
1284
|
-
) -> DeltaGenerator:
|
1285
|
-
...
|
1324
|
+
) -> DeltaGenerator: ...
|
1286
1325
|
|
1287
1326
|
@overload
|
1288
1327
|
def altair_chart(
|
@@ -1294,8 +1333,7 @@ class VegaChartsMixin:
|
|
1294
1333
|
key: Key | None = None,
|
1295
1334
|
on_select: Literal["rerun"] | WidgetCallback = "rerun",
|
1296
1335
|
selection_mode: str | Iterable[str] | None = None,
|
1297
|
-
) -> VegaLiteState:
|
1298
|
-
...
|
1336
|
+
) -> VegaLiteState: ...
|
1299
1337
|
|
1300
1338
|
@gather_metrics("altair_chart")
|
1301
1339
|
def altair_chart(
|
@@ -1435,8 +1473,7 @@ class VegaChartsMixin:
|
|
1435
1473
|
on_select: Literal["ignore"], # No default value here to make it work with mypy
|
1436
1474
|
selection_mode: str | Iterable[str] | None = None,
|
1437
1475
|
**kwargs: Any,
|
1438
|
-
) -> DeltaGenerator:
|
1439
|
-
...
|
1476
|
+
) -> DeltaGenerator: ...
|
1440
1477
|
|
1441
1478
|
@overload
|
1442
1479
|
def vega_lite_chart(
|
@@ -1450,8 +1487,7 @@ class VegaChartsMixin:
|
|
1450
1487
|
on_select: Literal["rerun"] | WidgetCallback = "rerun",
|
1451
1488
|
selection_mode: str | Iterable[str] | None = None,
|
1452
1489
|
**kwargs: Any,
|
1453
|
-
) -> VegaLiteState:
|
1454
|
-
...
|
1490
|
+
) -> VegaLiteState: ...
|
1455
1491
|
|
1456
1492
|
@gather_metrics("vega_lite_chart")
|
1457
1493
|
def vega_lite_chart(
|
@@ -17,9 +17,8 @@ from __future__ import annotations
|
|
17
17
|
import re
|
18
18
|
from dataclasses import dataclass
|
19
19
|
from textwrap import dedent
|
20
|
-
from typing import cast
|
20
|
+
from typing import TYPE_CHECKING, cast
|
21
21
|
|
22
|
-
import streamlit
|
23
22
|
from streamlit.elements.form import current_form_id
|
24
23
|
from streamlit.elements.lib.policies import (
|
25
24
|
check_cache_replay_rules,
|
@@ -41,6 +40,9 @@ from streamlit.runtime.state import (
|
|
41
40
|
from streamlit.runtime.state.common import compute_widget_id
|
42
41
|
from streamlit.type_util import Key, LabelVisibility, maybe_raise_label_warnings, to_key
|
43
42
|
|
43
|
+
if TYPE_CHECKING:
|
44
|
+
from streamlit.delta_generator import DeltaGenerator
|
45
|
+
|
44
46
|
|
45
47
|
@dataclass
|
46
48
|
class ColorPickerSerde:
|
@@ -253,6 +255,6 @@ class ColorPickerMixin:
|
|
253
255
|
return widget_state.value
|
254
256
|
|
255
257
|
@property
|
256
|
-
def dg(self) ->
|
258
|
+
def dg(self) -> DeltaGenerator:
|
257
259
|
"""Get our DeltaGenerator."""
|
258
|
-
return cast("
|
260
|
+
return cast("DeltaGenerator", self)
|
@@ -162,8 +162,7 @@ class FileUploaderMixin:
|
|
162
162
|
*,
|
163
163
|
disabled: bool = False,
|
164
164
|
label_visibility: LabelVisibility = "visible",
|
165
|
-
) -> list[UploadedFile] | None:
|
166
|
-
...
|
165
|
+
) -> list[UploadedFile] | None: ...
|
167
166
|
|
168
167
|
# 1. type is given as not a keyword-only argument
|
169
168
|
# 2. accept_multiple_files = False or omitted
|
@@ -181,8 +180,7 @@ class FileUploaderMixin:
|
|
181
180
|
*,
|
182
181
|
disabled: bool = False,
|
183
182
|
label_visibility: LabelVisibility = "visible",
|
184
|
-
) -> UploadedFile | None:
|
185
|
-
...
|
183
|
+
) -> UploadedFile | None: ...
|
186
184
|
|
187
185
|
# The following 2 overloads represent the cases where
|
188
186
|
# the `type` argument is a keyword-only argument.
|
@@ -205,8 +203,7 @@ class FileUploaderMixin:
|
|
205
203
|
kwargs: WidgetKwargs | None = None,
|
206
204
|
disabled: bool = False,
|
207
205
|
label_visibility: LabelVisibility = "visible",
|
208
|
-
) -> list[UploadedFile] | None:
|
209
|
-
...
|
206
|
+
) -> list[UploadedFile] | None: ...
|
210
207
|
|
211
208
|
# 1. type is skipped or a keyword argument
|
212
209
|
# 2. accept_multiple_files = False or omitted
|
@@ -224,8 +221,7 @@ class FileUploaderMixin:
|
|
224
221
|
kwargs: WidgetKwargs | None = None,
|
225
222
|
disabled: bool = False,
|
226
223
|
label_visibility: LabelVisibility = "visible",
|
227
|
-
) -> UploadedFile | None:
|
228
|
-
...
|
224
|
+
) -> UploadedFile | None: ...
|
229
225
|
|
230
226
|
@gather_metrics("file_uploader")
|
231
227
|
def file_uploader(
|
@@ -60,15 +60,13 @@ if TYPE_CHECKING:
|
|
60
60
|
@overload
|
61
61
|
def _check_and_convert_to_indices( # type: ignore[misc]
|
62
62
|
opt: Sequence[Any], default_values: None
|
63
|
-
) -> list[int] | None:
|
64
|
-
...
|
63
|
+
) -> list[int] | None: ...
|
65
64
|
|
66
65
|
|
67
66
|
@overload
|
68
67
|
def _check_and_convert_to_indices(
|
69
68
|
opt: Sequence[Any], default_values: Sequence[Any] | Any
|
70
|
-
) -> list[int]:
|
71
|
-
...
|
69
|
+
) -> list[int]: ...
|
72
70
|
|
73
71
|
|
74
72
|
def _check_and_convert_to_indices(
|
@@ -401,17 +401,13 @@ class NumberInputMixin:
|
|
401
401
|
try:
|
402
402
|
if all_ints:
|
403
403
|
if min_value is not None:
|
404
|
-
JSNumber.validate_int_bounds(
|
405
|
-
min_value, "`min_value`" # type: ignore
|
406
|
-
)
|
404
|
+
JSNumber.validate_int_bounds(int(min_value), "`min_value`")
|
407
405
|
if max_value is not None:
|
408
|
-
JSNumber.validate_int_bounds(
|
409
|
-
max_value, "`max_value`" # type: ignore
|
410
|
-
)
|
406
|
+
JSNumber.validate_int_bounds(int(max_value), "`max_value`")
|
411
407
|
if step is not None:
|
412
|
-
JSNumber.validate_int_bounds(step, "`step`")
|
408
|
+
JSNumber.validate_int_bounds(int(step), "`step`")
|
413
409
|
if value is not None:
|
414
|
-
JSNumber.validate_int_bounds(value, "`value`")
|
410
|
+
JSNumber.validate_int_bounds(int(value), "`value`")
|
415
411
|
else:
|
416
412
|
if min_value is not None:
|
417
413
|
JSNumber.validate_float_bounds(min_value, "`min_value`")
|
@@ -87,7 +87,7 @@ class SelectSliderSerde(Generic[T]):
|
|
87
87
|
# The widget always returns floats, so convert to ints before indexing
|
88
88
|
return_value: tuple[T, T] = cast(
|
89
89
|
Tuple[T, T],
|
90
|
-
tuple(
|
90
|
+
tuple(self.options[int(x)] for x in ui_value),
|
91
91
|
)
|
92
92
|
|
93
93
|
# If the original value was a list/tuple, so will be the output (and vice versa)
|
@@ -519,12 +519,9 @@ class SliderMixin:
|
|
519
519
|
|
520
520
|
# Ensure that all arguments are of the same type.
|
521
521
|
slider_args = [min_value, max_value, step]
|
522
|
-
int_args = all(
|
522
|
+
int_args = all(isinstance(a, Integral) for a in slider_args)
|
523
523
|
float_args = all(
|
524
|
-
|
525
|
-
lambda a: isinstance(a, Real) and not isinstance(a, Integral),
|
526
|
-
slider_args,
|
527
|
-
)
|
524
|
+
isinstance(a, Real) and not isinstance(a, Integral) for a in slider_args
|
528
525
|
)
|
529
526
|
# When min and max_value are the same timelike, step should be a timedelta
|
530
527
|
timelike_args = (
|
@@ -72,7 +72,7 @@ ALLOWED_DATE_FORMATS: Final = re.compile(
|
|
72
72
|
|
73
73
|
|
74
74
|
def _parse_date_value(
|
75
|
-
value:
|
75
|
+
value: Literal["today", "default_value_today"] | DateValue,
|
76
76
|
) -> tuple[list[date] | None, bool]:
|
77
77
|
parsed_dates: list[date]
|
78
78
|
range_value: bool = False
|
@@ -87,7 +87,7 @@ def _parse_date_value(
|
|
87
87
|
elif isinstance(value, date):
|
88
88
|
parsed_dates = [value]
|
89
89
|
elif isinstance(value, (list, tuple)):
|
90
|
-
if
|
90
|
+
if len(value) not in {0, 1, 2}:
|
91
91
|
raise StreamlitAPIException(
|
92
92
|
"DateInput value should either be an date/datetime or a list/tuple of "
|
93
93
|
"0 - 2 date/datetime values"
|
@@ -155,7 +155,7 @@ class _DateInputValues:
|
|
155
155
|
@classmethod
|
156
156
|
def from_raw_values(
|
157
157
|
cls,
|
158
|
-
value:
|
158
|
+
value: Literal["today", "default_value_today"] | DateValue,
|
159
159
|
min_value: SingleDateValue,
|
160
160
|
max_value: SingleDateValue,
|
161
161
|
) -> _DateInputValues:
|
@@ -677,7 +677,7 @@ class TimeWidgetsMixin:
|
|
677
677
|
self,
|
678
678
|
label: str,
|
679
679
|
value: (
|
680
|
-
|
680
|
+
Literal["today", "default_value_today"] | DateValue
|
681
681
|
) = "default_value_today",
|
682
682
|
min_value: SingleDateValue = None,
|
683
683
|
max_value: SingleDateValue = None,
|
@@ -703,7 +703,7 @@ class TimeWidgetsMixin:
|
|
703
703
|
maybe_raise_label_warnings(label, label_visibility)
|
704
704
|
|
705
705
|
def parse_date_deterministic(
|
706
|
-
v: SingleDateValue | Literal["today"
|
706
|
+
v: SingleDateValue | Literal["today", "default_value_today"],
|
707
707
|
) -> str | None:
|
708
708
|
if isinstance(v, datetime):
|
709
709
|
return date.strftime(v.date(), "%Y/%m/%d")
|
streamlit/errors.py
CHANGED
@@ -130,12 +130,7 @@ or in your `.streamlit/config.toml`
|
|
130
130
|
[deprecation]
|
131
131
|
{2} = false
|
132
132
|
```
|
133
|
-
""".format(
|
134
|
-
msg, config_option, config_option.split(".")[1]
|
135
|
-
)
|
136
|
-
# TODO: create a deprecation docs page to add to deprecation msg #1669
|
137
|
-
# For more details, please see: https://docs.streamlit.io/path/to/deprecation/docs.html
|
138
|
-
|
133
|
+
""".format(msg, config_option, config_option.split(".")[1])
|
139
134
|
super().__init__(message, *args)
|
140
135
|
|
141
136
|
def __repr__(self) -> str:
|
streamlit/git_util.py
CHANGED
@@ -106,11 +106,11 @@ class GitRepo:
|
|
106
106
|
|
107
107
|
try:
|
108
108
|
remote, branch_name = self.get_tracking_branch_remote()
|
109
|
-
remote_branch = "
|
109
|
+
remote_branch = f"{remote.name}/{branch_name}"
|
110
110
|
|
111
111
|
return list(self.repo.iter_commits(f"{remote_branch}..{branch_name}"))
|
112
112
|
except Exception:
|
113
|
-
return
|
113
|
+
return []
|
114
114
|
|
115
115
|
def get_tracking_branch_remote(self):
|
116
116
|
if not self.is_valid():
|
@@ -21,7 +21,6 @@ from streamlit.hello.utils import show_code
|
|
21
21
|
|
22
22
|
|
23
23
|
def animation_demo() -> None:
|
24
|
-
|
25
24
|
# Interactive Streamlit elements, like these sliders, return their value.
|
26
25
|
# This gives you an extremely simple interaction model.
|
27
26
|
iterations = st.sidebar.slider("Level of detail", 2, 20, 10, 1)
|
streamlit/logger.py
CHANGED
@@ -20,7 +20,7 @@ import logging
|
|
20
20
|
import sys
|
21
21
|
from typing import Final
|
22
22
|
|
23
|
-
DEFAULT_LOG_MESSAGE: Final = "%(asctime)s %(levelname) -7s
|
23
|
+
DEFAULT_LOG_MESSAGE: Final = "%(asctime)s %(levelname) -7s %(name)s: %(message)s"
|
24
24
|
|
25
25
|
# Loggers for each name are saved here.
|
26
26
|
_loggers: dict[str, logging.Logger] = {}
|
streamlit/navigation/page.py
CHANGED
@@ -35,7 +35,7 @@ def Page(
|
|
35
35
|
url_path: str | None = None,
|
36
36
|
default: bool = False,
|
37
37
|
):
|
38
|
-
"""Configure a page in
|
38
|
+
"""Configure a page in `st.navigation` in a multipage app.
|
39
39
|
|
40
40
|
The Page object is passed to `st.navigation` and returned when the user
|
41
41
|
navigates to that page. Call `Page.run()` on the returned Page in your
|
@@ -119,6 +119,11 @@ class StreamlitPage:
|
|
119
119
|
if isinstance(page, Path):
|
120
120
|
page = (main_path / page).resolve()
|
121
121
|
|
122
|
+
if not page.is_file():
|
123
|
+
raise StreamlitAPIException(
|
124
|
+
f"Unable to create Page. The file `{page.name}` could not be found."
|
125
|
+
)
|
126
|
+
|
122
127
|
inferred_name = ""
|
123
128
|
inferred_icon = ""
|
124
129
|
if isinstance(page, Path):
|
streamlit/net_util.py
CHANGED
@@ -52,11 +52,8 @@ def get_external_ip() -> str | None:
|
|
52
52
|
_external_ip = response
|
53
53
|
else:
|
54
54
|
_LOGGER.warning(
|
55
|
-
|
56
|
-
|
57
|
-
"Please go to %s for debugging hints.",
|
58
|
-
# fmt: on
|
59
|
-
util.HELP_DOC
|
55
|
+
"Did not auto detect external IP.\nPlease go to %s for debugging hints.",
|
56
|
+
util.HELP_DOC,
|
60
57
|
)
|
61
58
|
_external_ip = None
|
62
59
|
|
streamlit/proto/AutoRerun_pb2.py
CHANGED
@@ -14,13 +14,14 @@ _sym_db = _symbol_database.Default()
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fstreamlit/proto/AutoRerun.proto\"2\n\tAutoRerun\x12\x10\n\x08interval\x18\x01 \x01(\x02\x12\x13\n\x0b\x66ragment_id\x18\x02 \x01(\
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fstreamlit/proto/AutoRerun.proto\"2\n\tAutoRerun\x12\x10\n\x08interval\x18\x01 \x01(\x02\x12\x13\n\x0b\x66ragment_id\x18\x02 \x01(\tB.\n\x1c\x63om.snowflake.apps.streamlitB\x0e\x41utoRerunProtob\x06proto3')
|
18
18
|
|
19
19
|
_globals = globals()
|
20
20
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
21
21
|
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'streamlit.proto.AutoRerun_pb2', _globals)
|
22
22
|
if not _descriptor._USE_C_DESCRIPTORS:
|
23
|
-
DESCRIPTOR._loaded_options = None
|
23
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
24
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n\034com.snowflake.apps.streamlitB\016AutoRerunProto'
|
24
25
|
_globals['_AUTORERUN']._serialized_start=35
|
25
26
|
_globals['_AUTORERUN']._serialized_end=85
|
26
27
|
# @@protoc_insertion_point(module_scope)
|
streamlit/proto/Block_pb2.py
CHANGED
@@ -14,7 +14,7 @@ _sym_db = _symbol_database.Default()
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Block.proto\"\
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bstreamlit/proto/Block.proto\"\xb2\t\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\x13\n\x0b\x61llow_empty\x18\x08 \x01(\x08\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\x98\x01\n\x06\x43olumn\x12\x0e\n\x06weight\x18\x01 \x01(\x01\x12\x0b\n\x03gap\x18\x02 \x01(\t\x12;\n\x12vertical_alignment\x18\x03 \x01(\x0e\x32\x1f.Block.Column.VerticalAlignment\"4\n\x11VerticalAlignment\x12\x07\n\x03TOP\x10\x00\x12\n\n\x06\x43\x45NTER\x10\x01\x12\n\n\x06\x42OTTOM\x10\x02\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\x1a@\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\x1a\x0e\n\x0cTabContainer\x1a\x14\n\x03Tab\x12\r\n\x05label\x18\x01 \x01(\t\x1aU\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\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*\n\x1c\x63om.snowflake.apps.streamlitB\nBlockProtob\x06proto3')
|
18
18
|
|
19
19
|
_globals = globals()
|
20
20
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
@@ -23,29 +23,31 @@ 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\nBlockProto'
|
25
25
|
_globals['_BLOCK']._serialized_start=32
|
26
|
-
_globals['_BLOCK']._serialized_end=
|
26
|
+
_globals['_BLOCK']._serialized_end=1234
|
27
27
|
_globals['_BLOCK_VERTICAL']._serialized_start=428
|
28
28
|
_globals['_BLOCK_VERTICAL']._serialized_end=470
|
29
29
|
_globals['_BLOCK_HORIZONTAL']._serialized_start=472
|
30
30
|
_globals['_BLOCK_HORIZONTAL']._serialized_end=497
|
31
|
-
_globals['_BLOCK_COLUMN']._serialized_start=
|
32
|
-
_globals['_BLOCK_COLUMN']._serialized_end=
|
33
|
-
_globals['
|
34
|
-
_globals['
|
35
|
-
_globals['
|
36
|
-
_globals['
|
37
|
-
_globals['
|
38
|
-
_globals['
|
39
|
-
_globals['
|
40
|
-
_globals['
|
41
|
-
_globals['
|
42
|
-
_globals['
|
43
|
-
_globals['
|
44
|
-
_globals['
|
45
|
-
_globals['
|
46
|
-
_globals['
|
47
|
-
_globals['
|
48
|
-
_globals['
|
49
|
-
_globals['
|
50
|
-
_globals['
|
31
|
+
_globals['_BLOCK_COLUMN']._serialized_start=500
|
32
|
+
_globals['_BLOCK_COLUMN']._serialized_end=652
|
33
|
+
_globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_start=600
|
34
|
+
_globals['_BLOCK_COLUMN_VERTICALALIGNMENT']._serialized_end=652
|
35
|
+
_globals['_BLOCK_EXPANDABLE']._serialized_start=654
|
36
|
+
_globals['_BLOCK_EXPANDABLE']._serialized_end=731
|
37
|
+
_globals['_BLOCK_DIALOG']._serialized_start=734
|
38
|
+
_globals['_BLOCK_DIALOG']._serialized_end=891
|
39
|
+
_globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_start=844
|
40
|
+
_globals['_BLOCK_DIALOG_DIALOGWIDTH']._serialized_end=879
|
41
|
+
_globals['_BLOCK_FORM']._serialized_start=893
|
42
|
+
_globals['_BLOCK_FORM']._serialized_end=957
|
43
|
+
_globals['_BLOCK_TABCONTAINER']._serialized_start=959
|
44
|
+
_globals['_BLOCK_TABCONTAINER']._serialized_end=973
|
45
|
+
_globals['_BLOCK_TAB']._serialized_start=975
|
46
|
+
_globals['_BLOCK_TAB']._serialized_end=995
|
47
|
+
_globals['_BLOCK_POPOVER']._serialized_start=997
|
48
|
+
_globals['_BLOCK_POPOVER']._serialized_end=1082
|
49
|
+
_globals['_BLOCK_CHATMESSAGE']._serialized_start=1085
|
50
|
+
_globals['_BLOCK_CHATMESSAGE']._serialized_end=1226
|
51
|
+
_globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_start=1182
|
52
|
+
_globals['_BLOCK_CHATMESSAGE_AVATARTYPE']._serialized_end=1226
|
51
53
|
# @@protoc_insertion_point(module_scope)
|
streamlit/proto/Block_pb2.pyi
CHANGED
@@ -69,17 +69,35 @@ class Block(google.protobuf.message.Message):
|
|
69
69
|
class Column(google.protobuf.message.Message):
|
70
70
|
DESCRIPTOR: google.protobuf.descriptor.Descriptor
|
71
71
|
|
72
|
+
class _VerticalAlignment:
|
73
|
+
ValueType = typing.NewType("ValueType", builtins.int)
|
74
|
+
V: typing_extensions.TypeAlias = ValueType
|
75
|
+
|
76
|
+
class _VerticalAlignmentEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Block.Column._VerticalAlignment.ValueType], builtins.type):
|
77
|
+
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
|
78
|
+
TOP: Block.Column._VerticalAlignment.ValueType # 0
|
79
|
+
CENTER: Block.Column._VerticalAlignment.ValueType # 1
|
80
|
+
BOTTOM: Block.Column._VerticalAlignment.ValueType # 2
|
81
|
+
|
82
|
+
class VerticalAlignment(_VerticalAlignment, metaclass=_VerticalAlignmentEnumTypeWrapper): ...
|
83
|
+
TOP: Block.Column.VerticalAlignment.ValueType # 0
|
84
|
+
CENTER: Block.Column.VerticalAlignment.ValueType # 1
|
85
|
+
BOTTOM: Block.Column.VerticalAlignment.ValueType # 2
|
86
|
+
|
72
87
|
WEIGHT_FIELD_NUMBER: builtins.int
|
73
88
|
GAP_FIELD_NUMBER: builtins.int
|
89
|
+
VERTICAL_ALIGNMENT_FIELD_NUMBER: builtins.int
|
74
90
|
weight: builtins.float
|
75
91
|
gap: builtins.str
|
92
|
+
vertical_alignment: global___Block.Column.VerticalAlignment.ValueType
|
76
93
|
def __init__(
|
77
94
|
self,
|
78
95
|
*,
|
79
96
|
weight: builtins.float = ...,
|
80
97
|
gap: builtins.str = ...,
|
98
|
+
vertical_alignment: global___Block.Column.VerticalAlignment.ValueType = ...,
|
81
99
|
) -> None: ...
|
82
|
-
def ClearField(self, field_name: typing.Literal["gap", b"gap", "weight", b"weight"]) -> None: ...
|
100
|
+
def ClearField(self, field_name: typing.Literal["gap", b"gap", "vertical_alignment", b"vertical_alignment", "weight", b"weight"]) -> None: ...
|
83
101
|
|
84
102
|
@typing.final
|
85
103
|
class Expandable(google.protobuf.message.Message):
|
streamlit/runtime/app_session.py
CHANGED
@@ -24,7 +24,6 @@ import streamlit.elements.exception as exception_utils
|
|
24
24
|
from streamlit import config, runtime
|
25
25
|
from streamlit.case_converters import to_snake_case
|
26
26
|
from streamlit.logger import get_logger
|
27
|
-
from streamlit.proto.BackMsg_pb2 import BackMsg
|
28
27
|
from streamlit.proto.ClientState_pb2 import ClientState
|
29
28
|
from streamlit.proto.Common_pb2 import FileURLs, FileURLsRequest
|
30
29
|
from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
|
@@ -35,23 +34,24 @@ from streamlit.proto.NewSession_pb2 import (
|
|
35
34
|
NewSession,
|
36
35
|
UserInfo,
|
37
36
|
)
|
38
|
-
from streamlit.proto.PagesChanged_pb2 import PagesChanged
|
39
37
|
from streamlit.runtime import caching
|
40
38
|
from streamlit.runtime.forward_msg_queue import ForwardMsgQueue
|
41
39
|
from streamlit.runtime.fragment import FragmentStorage, MemoryFragmentStorage
|
42
40
|
from streamlit.runtime.metrics_util import Installation
|
43
41
|
from streamlit.runtime.pages_manager import PagesManager
|
44
|
-
from streamlit.runtime.script_data import ScriptData
|
45
42
|
from streamlit.runtime.scriptrunner import RerunData, ScriptRunner, ScriptRunnerEvent
|
46
|
-
from streamlit.runtime.scriptrunner.script_cache import ScriptCache
|
47
43
|
from streamlit.runtime.secrets import secrets_singleton
|
48
|
-
from streamlit.runtime.uploaded_file_manager import UploadedFileManager
|
49
|
-
from streamlit.source_util import PageHash, PageInfo
|
50
44
|
from streamlit.version import STREAMLIT_VERSION_STRING
|
51
45
|
from streamlit.watcher import LocalSourcesWatcher
|
52
46
|
|
53
47
|
if TYPE_CHECKING:
|
48
|
+
from streamlit.proto.BackMsg_pb2 import BackMsg
|
49
|
+
from streamlit.proto.PagesChanged_pb2 import PagesChanged
|
50
|
+
from streamlit.runtime.script_data import ScriptData
|
51
|
+
from streamlit.runtime.scriptrunner.script_cache import ScriptCache
|
54
52
|
from streamlit.runtime.state import SessionState
|
53
|
+
from streamlit.runtime.uploaded_file_manager import UploadedFileManager
|
54
|
+
from streamlit.source_util import PageHash, PageInfo
|
55
55
|
|
56
56
|
_LOGGER: Final = get_logger(__name__)
|
57
57
|
|
@@ -881,7 +881,7 @@ def _populate_config_msg(msg: Config) -> None:
|
|
881
881
|
msg.hide_top_bar = config.get_option("ui.hideTopBar")
|
882
882
|
# ui.hideSidebarNav is deprecated, will be removed in the future
|
883
883
|
msg.hide_sidebar_nav = config.get_option("ui.hideSidebarNav")
|
884
|
-
if config.get_option("client.showSidebarNavigation")
|
884
|
+
if config.get_option("client.showSidebarNavigation") is False:
|
885
885
|
msg.hide_sidebar_nav = True
|
886
886
|
msg.toolbar_mode = _get_toolbar_mode()
|
887
887
|
|