streamlit-nightly 1.37.2.dev20240807__py2.py3-none-any.whl → 1.37.2.dev20240808__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/dataframe_util.py +79 -31
- streamlit/elements/lib/built_in_chart_utils.py +3 -7
- streamlit/elements/lib/options_selector_utils.py +3 -19
- streamlit/elements/write.py +12 -2
- streamlit/hello/Animation_Demo.py +1 -1
- streamlit/hello/Dataframe_Demo.py +1 -1
- streamlit/hello/Hello.py +1 -1
- streamlit/hello/Mapping_Demo.py +1 -1
- streamlit/hello/Plotting_Demo.py +1 -1
- streamlit/hello/streamlit_app.py +5 -5
- streamlit/runtime/metrics_util.py +5 -1
- streamlit/type_util.py +29 -8
- {streamlit_nightly-1.37.2.dev20240807.dist-info → streamlit_nightly-1.37.2.dev20240808.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.37.2.dev20240807.dist-info → streamlit_nightly-1.37.2.dev20240808.dist-info}/RECORD +18 -18
- {streamlit_nightly-1.37.2.dev20240807.data → streamlit_nightly-1.37.2.dev20240808.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.37.2.dev20240807.dist-info → streamlit_nightly-1.37.2.dev20240808.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.37.2.dev20240807.dist-info → streamlit_nightly-1.37.2.dev20240808.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.37.2.dev20240807.dist-info → streamlit_nightly-1.37.2.dev20240808.dist-info}/top_level.txt +0 -0
streamlit/dataframe_util.py
CHANGED
@@ -21,8 +21,8 @@ import dataclasses
|
|
21
21
|
import inspect
|
22
22
|
import math
|
23
23
|
import re
|
24
|
-
from collections import ChainMap, UserDict, deque
|
25
|
-
from collections.abc import ItemsView,
|
24
|
+
from collections import ChainMap, UserDict, UserList, deque
|
25
|
+
from collections.abc import ItemsView, Mapping
|
26
26
|
from enum import Enum, EnumMeta, auto
|
27
27
|
from types import MappingProxyType
|
28
28
|
from typing import (
|
@@ -31,8 +31,8 @@ from typing import (
|
|
31
31
|
Dict,
|
32
32
|
Final,
|
33
33
|
Iterable,
|
34
|
+
List,
|
34
35
|
Protocol,
|
35
|
-
Sequence,
|
36
36
|
TypeVar,
|
37
37
|
Union,
|
38
38
|
cast,
|
@@ -45,6 +45,7 @@ from streamlit.type_util import (
|
|
45
45
|
has_callable_attr,
|
46
46
|
is_custom_dict,
|
47
47
|
is_dataclass_instance,
|
48
|
+
is_list_like,
|
48
49
|
is_namedtuple,
|
49
50
|
is_type,
|
50
51
|
)
|
@@ -64,6 +65,8 @@ _MAX_UNEVALUATED_DF_ROWS = 10000
|
|
64
65
|
|
65
66
|
_PANDAS_DATA_OBJECT_TYPE_RE: Final = re.compile(r"^pandas.*$")
|
66
67
|
_PANDAS_STYLER_TYPE_STR: Final = "pandas.io.formats.style.Styler"
|
68
|
+
_XARRAY_DATA_ARRAY_TYPE_STR: Final = "xarray.core.dataarray.DataArray"
|
69
|
+
_XARRAY_DATASET_TYPE_STR: Final = "xarray.core.dataset.Dataset"
|
67
70
|
_SNOWPARK_DF_TYPE_STR: Final = "snowflake.snowpark.dataframe.DataFrame"
|
68
71
|
_SNOWPARK_DF_ROW_TYPE_STR: Final = "snowflake.snowpark.row.Row"
|
69
72
|
_SNOWPARK_TABLE_TYPE_STR: Final = "snowflake.snowpark.table.Table"
|
@@ -141,6 +144,8 @@ class DataFormat(Enum):
|
|
141
144
|
POLARS_DATAFRAME = auto() # polars.dataframe.frame.DataFrame
|
142
145
|
POLARS_LAZYFRAME = auto() # polars.lazyframe.frame.LazyFrame
|
143
146
|
POLARS_SERIES = auto() # polars.series.series.Series
|
147
|
+
XARRAY_DATASET = auto() # xarray.Dataset
|
148
|
+
XARRAY_DATA_ARRAY = auto() # xarray.DataArray
|
144
149
|
LIST_OF_RECORDS = auto() # List[Dict[str, Scalar]]
|
145
150
|
LIST_OF_ROWS = auto() # List[List[Scalar]]
|
146
151
|
LIST_OF_VALUES = auto() # List[Scalar]
|
@@ -182,6 +187,8 @@ def is_dataframe_like(obj: object) -> bool:
|
|
182
187
|
DataFormat.POLARS_SERIES,
|
183
188
|
DataFormat.POLARS_DATAFRAME,
|
184
189
|
DataFormat.POLARS_LAZYFRAME,
|
190
|
+
DataFormat.XARRAY_DATASET,
|
191
|
+
DataFormat.XARRAY_DATA_ARRAY,
|
185
192
|
DataFormat.COLUMN_SERIES_MAPPING,
|
186
193
|
]
|
187
194
|
|
@@ -259,6 +266,16 @@ def is_polars_dataframe(obj: object) -> bool:
|
|
259
266
|
return is_type(obj, _POLARS_DATAFRAME)
|
260
267
|
|
261
268
|
|
269
|
+
def is_xarray_dataset(obj: object) -> bool:
|
270
|
+
"""True if obj is a Xarray Dataset."""
|
271
|
+
return is_type(obj, _XARRAY_DATASET_TYPE_STR)
|
272
|
+
|
273
|
+
|
274
|
+
def is_xarray_data_array(obj: object) -> bool:
|
275
|
+
"""True if obj is a Xarray DataArray."""
|
276
|
+
return is_type(obj, _XARRAY_DATA_ARRAY_TYPE_STR)
|
277
|
+
|
278
|
+
|
262
279
|
def is_polars_series(obj: object) -> bool:
|
263
280
|
"""True if obj is a Polars Series."""
|
264
281
|
return is_type(obj, _POLARS_SERIES)
|
@@ -409,6 +426,16 @@ def convert_anything_to_pandas_df(
|
|
409
426
|
)
|
410
427
|
return cast(pd.DataFrame, data)
|
411
428
|
|
429
|
+
if is_xarray_dataset(data):
|
430
|
+
if ensure_copy:
|
431
|
+
data = data.copy(deep=True)
|
432
|
+
return data.to_dataframe()
|
433
|
+
|
434
|
+
if is_xarray_data_array(data):
|
435
|
+
if ensure_copy:
|
436
|
+
data = data.copy(deep=True)
|
437
|
+
return data.to_series().to_frame()
|
438
|
+
|
412
439
|
if is_modin_data_object(data):
|
413
440
|
data = data.head(max_unevaluated_rows)._to_pandas()
|
414
441
|
|
@@ -477,7 +504,7 @@ def convert_anything_to_pandas_df(
|
|
477
504
|
return _fix_column_naming(pd.DataFrame([c.value for c in data])) # type: ignore
|
478
505
|
|
479
506
|
# Support for some list like objects
|
480
|
-
if isinstance(data, (deque, map, array.ArrayType)):
|
507
|
+
if isinstance(data, (deque, map, array.ArrayType, UserList)):
|
481
508
|
return _fix_column_naming(pd.DataFrame(list(data)))
|
482
509
|
|
483
510
|
# Support for Streamlit's custom dict-like objects
|
@@ -661,36 +688,44 @@ def convert_anything_to_arrow_bytes(
|
|
661
688
|
return convert_pandas_df_to_arrow_bytes(df)
|
662
689
|
|
663
690
|
|
664
|
-
def convert_anything_to_sequence(obj: OptionSequence[V_co]) ->
|
665
|
-
"""Try to convert different formats to
|
691
|
+
def convert_anything_to_sequence(obj: OptionSequence[V_co]) -> list[V_co]:
|
692
|
+
"""Try to convert different formats to a list.
|
666
693
|
|
667
694
|
If the input is a dataframe-like object, we just select the first
|
668
|
-
column to iterate over.
|
669
|
-
|
695
|
+
column to iterate over. Non sequence-like objects and scalar types,
|
696
|
+
will just be wrapped into a list.
|
670
697
|
|
671
698
|
Parameters
|
672
699
|
----------
|
700
|
+
|
673
701
|
obj : OptionSequence
|
674
|
-
The object to convert to a
|
702
|
+
The object to convert to a list.
|
675
703
|
|
676
704
|
Returns
|
677
705
|
-------
|
678
|
-
|
679
|
-
The converted
|
706
|
+
list
|
707
|
+
The converted list.
|
680
708
|
"""
|
681
709
|
if obj is None:
|
682
710
|
return [] # type: ignore
|
683
711
|
|
684
|
-
if isinstance(
|
685
|
-
|
686
|
-
|
712
|
+
if isinstance(obj, (str, int, float, bool)):
|
713
|
+
# Wrap basic objects into a list
|
714
|
+
return [obj]
|
715
|
+
|
716
|
+
if isinstance(obj, EnumMeta):
|
717
|
+
# Support for enum classes. For string enums, we return the string value
|
718
|
+
# of the enum members. For other enums, we just return the enum member.
|
719
|
+
return [member.value if isinstance(member, str) else member for member in obj] # type: ignore
|
720
|
+
|
721
|
+
if isinstance(obj, Mapping):
|
722
|
+
return list(obj.keys())
|
723
|
+
|
724
|
+
if is_list_like(obj) and not is_snowpark_row_list(obj):
|
687
725
|
# This also ensures that the sequence is copied to prevent
|
688
726
|
# potential mutations to the original object.
|
689
727
|
return list(obj)
|
690
728
|
|
691
|
-
if isinstance(obj, dict):
|
692
|
-
return list(obj.keys())
|
693
|
-
|
694
729
|
# Fallback to our DataFrame conversion logic:
|
695
730
|
try:
|
696
731
|
# We use ensure_copy here because the return value of this function is
|
@@ -701,13 +736,13 @@ def convert_anything_to_sequence(obj: OptionSequence[V_co]) -> Sequence[V_co]:
|
|
701
736
|
data_df = convert_anything_to_pandas_df(obj, ensure_copy=True)
|
702
737
|
# Return first column as a list:
|
703
738
|
return (
|
704
|
-
[]
|
739
|
+
[]
|
740
|
+
if data_df.empty
|
741
|
+
else cast(List[V_co], list(data_df.iloc[:, 0].to_list()))
|
705
742
|
)
|
706
|
-
except errors.StreamlitAPIException
|
707
|
-
|
708
|
-
|
709
|
-
f"Object type: {type(obj)}"
|
710
|
-
) from e
|
743
|
+
except errors.StreamlitAPIException:
|
744
|
+
# Wrap the object into a list
|
745
|
+
return [obj] # type: ignore
|
711
746
|
|
712
747
|
|
713
748
|
def _maybe_truncate_table(
|
@@ -907,7 +942,6 @@ def determine_data_format(input_data: Any) -> DataFormat:
|
|
907
942
|
DataFormat
|
908
943
|
The data format of the input data.
|
909
944
|
"""
|
910
|
-
import array
|
911
945
|
|
912
946
|
import numpy as np
|
913
947
|
import pandas as pd
|
@@ -947,14 +981,17 @@ def determine_data_format(input_data: Any) -> DataFormat:
|
|
947
981
|
return DataFormat.SNOWPANDAS_OBJECT
|
948
982
|
elif is_pyspark_data_object(input_data):
|
949
983
|
return DataFormat.PYSPARK_OBJECT
|
984
|
+
elif is_xarray_dataset(input_data):
|
985
|
+
return DataFormat.XARRAY_DATASET
|
986
|
+
elif is_xarray_data_array(input_data):
|
987
|
+
return DataFormat.XARRAY_DATA_ARRAY
|
950
988
|
elif is_snowpark_data_object(input_data) or is_snowpark_row_list(input_data):
|
951
989
|
return DataFormat.SNOWPARK_OBJECT
|
952
|
-
elif isinstance(
|
953
|
-
input_data, (range, EnumMeta, KeysView, ValuesView, deque, map, array.ArrayType)
|
954
|
-
):
|
955
|
-
return DataFormat.LIST_OF_VALUES
|
956
990
|
elif (
|
957
|
-
isinstance(
|
991
|
+
isinstance(
|
992
|
+
input_data,
|
993
|
+
(ChainMap, UserDict, MappingProxyType),
|
994
|
+
)
|
958
995
|
or is_dataclass_instance(input_data)
|
959
996
|
or is_namedtuple(input_data)
|
960
997
|
or is_custom_dict(input_data)
|
@@ -979,7 +1016,7 @@ def determine_data_format(input_data: Any) -> DataFormat:
|
|
979
1016
|
return DataFormat.LIST_OF_RECORDS
|
980
1017
|
if isinstance(first_element, (list, tuple, set, frozenset)):
|
981
1018
|
return DataFormat.LIST_OF_ROWS
|
982
|
-
elif isinstance(input_data, dict):
|
1019
|
+
elif isinstance(input_data, (dict, Mapping)):
|
983
1020
|
if not input_data:
|
984
1021
|
return DataFormat.KEY_VALUE_DICT
|
985
1022
|
if len(input_data) > 0:
|
@@ -994,6 +1031,9 @@ def determine_data_format(input_data: Any) -> DataFormat:
|
|
994
1031
|
# Use key-value dict as fallback. However, if the values of the dict
|
995
1032
|
# contains mixed types, it will become non-editable in the frontend.
|
996
1033
|
return DataFormat.KEY_VALUE_DICT
|
1034
|
+
elif is_list_like(input_data):
|
1035
|
+
return DataFormat.LIST_OF_VALUES
|
1036
|
+
|
997
1037
|
return DataFormat.UNKNOWN
|
998
1038
|
|
999
1039
|
|
@@ -1051,7 +1091,7 @@ def convert_pandas_df_to_data_format(
|
|
1051
1091
|
|
1052
1092
|
Returns
|
1053
1093
|
-------
|
1054
|
-
pd.DataFrame, pd.Series, pyarrow.Table, np.ndarray, list, set, tuple, or dict.
|
1094
|
+
pd.DataFrame, pd.Series, pyarrow.Table, np.ndarray, xarray.Dataset, xarray.DataArray, polars.Dataframe, polars.Series, list, set, tuple, or dict.
|
1055
1095
|
The converted dataframe.
|
1056
1096
|
"""
|
1057
1097
|
|
@@ -1100,6 +1140,14 @@ def convert_pandas_df_to_data_format(
|
|
1100
1140
|
import polars as pl
|
1101
1141
|
|
1102
1142
|
return pl.from_pandas(_pandas_df_to_series(df))
|
1143
|
+
elif data_format == DataFormat.XARRAY_DATASET:
|
1144
|
+
import xarray as xr
|
1145
|
+
|
1146
|
+
return xr.Dataset.from_dataframe(df)
|
1147
|
+
elif data_format == DataFormat.XARRAY_DATA_ARRAY:
|
1148
|
+
import xarray as xr
|
1149
|
+
|
1150
|
+
return xr.DataArray.from_series(_pandas_df_to_series(df))
|
1103
1151
|
elif data_format == DataFormat.LIST_OF_RECORDS:
|
1104
1152
|
return _unify_missing_values(df).to_dict(orient="records")
|
1105
1153
|
elif data_format == DataFormat.LIST_OF_ROWS:
|
@@ -641,14 +641,10 @@ def _parse_y_columns(
|
|
641
641
|
elif isinstance(y_from_user, str):
|
642
642
|
y_column_list = [y_from_user]
|
643
643
|
|
644
|
-
elif type_util.is_sequence(y_from_user):
|
645
|
-
y_column_list = [str(col) for col in y_from_user]
|
646
|
-
|
647
644
|
else:
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
)
|
645
|
+
y_column_list = [
|
646
|
+
str(col) for col in dataframe_util.convert_anything_to_sequence(y_from_user)
|
647
|
+
]
|
652
648
|
|
653
649
|
for col in y_column_list:
|
654
650
|
if col not in df.columns:
|
@@ -17,7 +17,6 @@ from __future__ import annotations
|
|
17
17
|
from typing import (
|
18
18
|
Any,
|
19
19
|
Sequence,
|
20
|
-
cast,
|
21
20
|
)
|
22
21
|
|
23
22
|
from streamlit.dataframe_util import OptionSequence, convert_anything_to_sequence
|
@@ -25,7 +24,6 @@ from streamlit.errors import StreamlitAPIException
|
|
25
24
|
from streamlit.type_util import (
|
26
25
|
T,
|
27
26
|
check_python_comparable,
|
28
|
-
is_type,
|
29
27
|
)
|
30
28
|
|
31
29
|
|
@@ -33,25 +31,11 @@ def check_and_convert_to_indices(
|
|
33
31
|
opt: Sequence[Any], default_values: Sequence[Any] | Any | None
|
34
32
|
) -> list[int] | None:
|
35
33
|
"""Perform validation checks and return indices based on the default values."""
|
36
|
-
if default_values is None
|
34
|
+
if default_values is None:
|
37
35
|
return None
|
38
36
|
|
39
|
-
|
40
|
-
|
41
|
-
# right below) when x is of type pd.Series() or np.array() throws a
|
42
|
-
# ValueError exception.
|
43
|
-
if is_type(default_values, "numpy.ndarray") or is_type(
|
44
|
-
default_values, "pandas.core.series.Series"
|
45
|
-
):
|
46
|
-
default_values = list(cast(Sequence[Any], default_values))
|
47
|
-
elif (
|
48
|
-
isinstance(default_values, (tuple, set))
|
49
|
-
or default_values
|
50
|
-
and default_values not in opt
|
51
|
-
):
|
52
|
-
default_values = list(default_values)
|
53
|
-
else:
|
54
|
-
default_values = [default_values]
|
37
|
+
default_values = convert_anything_to_sequence(default_values)
|
38
|
+
|
55
39
|
for value in default_values:
|
56
40
|
if value not in opt:
|
57
41
|
raise StreamlitAPIException(
|
streamlit/elements/write.py
CHANGED
@@ -17,9 +17,18 @@ from __future__ import annotations
|
|
17
17
|
import dataclasses
|
18
18
|
import inspect
|
19
19
|
import types
|
20
|
-
from collections import ChainMap, UserDict
|
20
|
+
from collections import ChainMap, UserDict, UserList
|
21
21
|
from io import StringIO
|
22
|
-
from typing import
|
22
|
+
from typing import (
|
23
|
+
TYPE_CHECKING,
|
24
|
+
Any,
|
25
|
+
Callable,
|
26
|
+
Final,
|
27
|
+
Generator,
|
28
|
+
Iterable,
|
29
|
+
List,
|
30
|
+
cast,
|
31
|
+
)
|
23
32
|
|
24
33
|
from streamlit import dataframe_util, type_util
|
25
34
|
from streamlit.errors import StreamlitAPIException
|
@@ -447,6 +456,7 @@ class WriteMixin:
|
|
447
456
|
types.MappingProxyType,
|
448
457
|
UserDict,
|
449
458
|
ChainMap,
|
459
|
+
UserList,
|
450
460
|
),
|
451
461
|
)
|
452
462
|
or type_util.is_custom_dict(arg)
|
@@ -69,7 +69,7 @@ def animation_demo() -> None:
|
|
69
69
|
st.button("Re-run")
|
70
70
|
|
71
71
|
|
72
|
-
st.set_page_config(page_title="Animation Demo", page_icon="
|
72
|
+
st.set_page_config(page_title="Animation Demo", page_icon=":material/animation:")
|
73
73
|
st.markdown("# Animation Demo")
|
74
74
|
st.sidebar.header("Animation Demo")
|
75
75
|
st.write(
|
@@ -64,7 +64,7 @@ def data_frame_demo():
|
|
64
64
|
)
|
65
65
|
|
66
66
|
|
67
|
-
st.set_page_config(page_title="DataFrame Demo", page_icon="
|
67
|
+
st.set_page_config(page_title="DataFrame Demo", page_icon=":material/table:")
|
68
68
|
st.markdown("# DataFrame Demo")
|
69
69
|
st.sidebar.header("DataFrame Demo")
|
70
70
|
st.write(
|
streamlit/hello/Hello.py
CHANGED
streamlit/hello/Mapping_Demo.py
CHANGED
@@ -103,7 +103,7 @@ def mapping_demo():
|
|
103
103
|
)
|
104
104
|
|
105
105
|
|
106
|
-
st.set_page_config(page_title="Mapping Demo", page_icon="
|
106
|
+
st.set_page_config(page_title="Mapping Demo", page_icon=":material/public:")
|
107
107
|
st.markdown("# Mapping Demo")
|
108
108
|
st.sidebar.header("Mapping Demo")
|
109
109
|
st.write(
|
streamlit/hello/Plotting_Demo.py
CHANGED
@@ -42,7 +42,7 @@ def plotting_demo():
|
|
42
42
|
st.button("Re-run")
|
43
43
|
|
44
44
|
|
45
|
-
st.set_page_config(page_title="Plotting Demo", page_icon="
|
45
|
+
st.set_page_config(page_title="Plotting Demo", page_icon=":material/show_chart:")
|
46
46
|
st.markdown("# Plotting Demo")
|
47
47
|
st.sidebar.header("Plotting Demo")
|
48
48
|
st.write(
|
streamlit/hello/streamlit_app.py
CHANGED
@@ -22,11 +22,11 @@ dir_path = Path(__file__).parent
|
|
22
22
|
def run():
|
23
23
|
page = st.navigation(
|
24
24
|
[
|
25
|
-
st.Page(dir_path / "Hello.py"),
|
26
|
-
st.Page(dir_path / "Animation_Demo.py"),
|
27
|
-
st.Page(dir_path / "Plotting_Demo.py"),
|
28
|
-
st.Page(dir_path / "Mapping_Demo.py"),
|
29
|
-
st.Page(dir_path / "Dataframe_Demo.py"),
|
25
|
+
st.Page(dir_path / "Hello.py", icon=":material/waving_hand:"),
|
26
|
+
st.Page(dir_path / "Animation_Demo.py", icon=":material/animation:"),
|
27
|
+
st.Page(dir_path / "Plotting_Demo.py", icon=":material/show_chart:"),
|
28
|
+
st.Page(dir_path / "Mapping_Demo.py", icon=":material/public:"),
|
29
|
+
st.Page(dir_path / "Dataframe_Demo.py", icon=":material/table:"),
|
30
30
|
]
|
31
31
|
)
|
32
32
|
|
@@ -86,6 +86,11 @@ _ATTRIBUTIONS_TO_CHECK: Final = [
|
|
86
86
|
"cudf",
|
87
87
|
"xarray",
|
88
88
|
"ray",
|
89
|
+
"geopandas",
|
90
|
+
"mars",
|
91
|
+
"tables",
|
92
|
+
"zarr",
|
93
|
+
"datasets",
|
89
94
|
# ML & LLM Tools:
|
90
95
|
"mistralai",
|
91
96
|
"openai",
|
@@ -141,7 +146,6 @@ _ATTRIBUTIONS_TO_CHECK: Final = [
|
|
141
146
|
"pymilvus",
|
142
147
|
"lancedb",
|
143
148
|
# Others:
|
144
|
-
"datasets",
|
145
149
|
"snowflake",
|
146
150
|
"streamlit_extras",
|
147
151
|
"streamlit_pydantic",
|
streamlit/type_util.py
CHANGED
@@ -19,6 +19,9 @@ from __future__ import annotations
|
|
19
19
|
import dataclasses
|
20
20
|
import re
|
21
21
|
import types
|
22
|
+
from collections import UserList, deque
|
23
|
+
from collections.abc import ItemsView, KeysView, ValuesView
|
24
|
+
from enum import EnumMeta
|
22
25
|
from typing import (
|
23
26
|
TYPE_CHECKING,
|
24
27
|
Any,
|
@@ -309,15 +312,33 @@ def is_iterable(obj: object) -> TypeGuard[Iterable[Any]]:
|
|
309
312
|
return True
|
310
313
|
|
311
314
|
|
312
|
-
def
|
313
|
-
"""True if input looks like a
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
len(seq)
|
318
|
-
except Exception:
|
315
|
+
def is_list_like(obj: object) -> TypeGuard[Sequence[Any]]:
|
316
|
+
"""True if input looks like a list."""
|
317
|
+
import array
|
318
|
+
|
319
|
+
if isinstance(obj, str):
|
319
320
|
return False
|
320
|
-
|
321
|
+
|
322
|
+
if isinstance(obj, (list, set, tuple)):
|
323
|
+
# Optimization to check the most common types first
|
324
|
+
return True
|
325
|
+
|
326
|
+
return isinstance(
|
327
|
+
obj,
|
328
|
+
(
|
329
|
+
array.ArrayType,
|
330
|
+
deque,
|
331
|
+
EnumMeta,
|
332
|
+
enumerate,
|
333
|
+
frozenset,
|
334
|
+
ItemsView,
|
335
|
+
KeysView,
|
336
|
+
map,
|
337
|
+
range,
|
338
|
+
UserList,
|
339
|
+
ValuesView,
|
340
|
+
),
|
341
|
+
)
|
321
342
|
|
322
343
|
|
323
344
|
def check_python_comparable(seq: Sequence[Any]) -> None:
|
@@ -10,7 +10,7 @@ streamlit/config_option.py,sha256=7kfzt-xhJs3awfyIHsyRaTBSxLpz1RioobDl5uXV37g,11
|
|
10
10
|
streamlit/config_util.py,sha256=-MGb5eBrsZvNmqywmiBmo27ll1F9OmCDX4toGWglv2c,6015
|
11
11
|
streamlit/constants.py,sha256=KhNjCeooky2bbW7QMX3ijOA5enHIOgj6Xo4TBhtTJNE,798
|
12
12
|
streamlit/cursor.py,sha256=LUDB6o7xyGb1it_8rl5QU_N3MRhFCdtnd9tuTx78abU,6001
|
13
|
-
streamlit/dataframe_util.py,sha256=
|
13
|
+
streamlit/dataframe_util.py,sha256=EkcSPO01xQOQJZQnvZRohtMCR0AyQBVbr4ke3szBxnc,41006
|
14
14
|
streamlit/delta_generator.py,sha256=SZ6XDEE_MRF18Rsq9-e3-CxL7RYb71hCXiC1lsbkoX0,28493
|
15
15
|
streamlit/deprecation_util.py,sha256=3JxWWS424v1kQ-qOq-9sQNYPQ8_UERH3QpYtkWxLP74,6516
|
16
16
|
streamlit/development.py,sha256=iO-KQc62Do9uSwoa5vV2tfImqz3QPhJ1Md6DETcnHkc,813
|
@@ -32,7 +32,7 @@ streamlit/source_util.py,sha256=2KOVrEhBATVh9M_bnbg9OwWPORg1riCB63JzE7g8oK0,6145
|
|
32
32
|
streamlit/string_util.py,sha256=7cJbv9tgdrayuaFzky43kZwG9-99O7zzQBXHAq8y55A,6716
|
33
33
|
streamlit/temporary_directory.py,sha256=eBv5q0CR9GApa-itZBaGtqQKMl248H0HojEVKzkS9cc,1627
|
34
34
|
streamlit/time_util.py,sha256=zPDirzZDAOPzGogHy-4wOalfBb7zCNCvFEfkZf03otc,2836
|
35
|
-
streamlit/type_util.py,sha256=
|
35
|
+
streamlit/type_util.py,sha256=1Tq_BwTZqxzVJ5c6n7aQpq_LzFf0mSoGrOoMKlZxynk,11800
|
36
36
|
streamlit/url_util.py,sha256=iU1lpZhzW4ZjhjBhSdw39OzixnThIsxhXpDP-ZIgUT8,3019
|
37
37
|
streamlit/user_info.py,sha256=tvv__45d7cA6tNrGw1vHtWwc6QLtmXTM5xZoYeTs1cw,3383
|
38
38
|
streamlit/util.py,sha256=0Phev7Lytvcy_eqIjpoGl2-7mOODwAwArY2zJpavEh8,6375
|
@@ -91,16 +91,16 @@ streamlit/elements/spinner.py,sha256=qhA0DZo3ZEYQswFYuNdaXltenvmJR_18mqDQA64bK_Q
|
|
91
91
|
streamlit/elements/text.py,sha256=_OePOPcWymPrYoey6BFeB6IvjTmnUszFS9W0veUu3LA,1856
|
92
92
|
streamlit/elements/toast.py,sha256=UFh4Is6a9-aWG43SZadknKOEC16_KIvg6AR9QR1tnxk,3711
|
93
93
|
streamlit/elements/vega_charts.py,sha256=Bq2sHk3-3hEL1vUT051GtZyRuzHwM2CtOn92iv5DKOI,77939
|
94
|
-
streamlit/elements/write.py,sha256=
|
94
|
+
streamlit/elements/write.py,sha256=V61gXtoEYGryJVijobBGNd8Qa8hAnJPju7M0d-PQ4z4,20931
|
95
95
|
streamlit/elements/lib/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
|
96
|
-
streamlit/elements/lib/built_in_chart_utils.py,sha256=
|
96
|
+
streamlit/elements/lib/built_in_chart_utils.py,sha256=JfFoFdcI97pfcw5n1VjIxxZ11YgYWKp5AO5d3bveCDw,37304
|
97
97
|
streamlit/elements/lib/column_config_utils.py,sha256=hQD-hNJPTN8MOw6RBCJAOGQ66-KkladEzCfMZnRCo3A,15877
|
98
98
|
streamlit/elements/lib/column_types.py,sha256=anShsRYM3brr30bB7B-j3PBm3pJwD7dBpFz-7zwSfwY,51180
|
99
99
|
streamlit/elements/lib/dialog.py,sha256=qaQjJNeaXanqCBtJ-rDv1vY2oCLRSiigdi7qKtYaldw,5732
|
100
100
|
streamlit/elements/lib/dicttools.py,sha256=9zXu6Z5Ky4ul74RBGB8Roi5LDoB_GTo_0vd2GNSnohQ,3827
|
101
101
|
streamlit/elements/lib/event_utils.py,sha256=wJaZxBH-x9icnWmDuO9ukIQhHek9T2rcxlrD7UVzmvk,1496
|
102
102
|
streamlit/elements/lib/mutable_status_container.py,sha256=TKWzUcn7JJ26L4ZVGSS-Pdp-V3TKiSndzMYq_UCqnRU,6716
|
103
|
-
streamlit/elements/lib/options_selector_utils.py,sha256=
|
103
|
+
streamlit/elements/lib/options_selector_utils.py,sha256=eiJ6JMgcwSMc_tudYhjeKrN5CMPs3LOq7qSiPDlA1yQ,2109
|
104
104
|
streamlit/elements/lib/pandas_styler_utils.py,sha256=VMo1RnsnU5KpiA73heGHCN1qYlRP8IE7a3pqSvvKthk,8121
|
105
105
|
streamlit/elements/lib/policies.py,sha256=t60jZr4SAEfjudzxMB6S_BTc17zs-V98eexlkPjFcag,7086
|
106
106
|
streamlit/elements/lib/streamlit_plotly_theme.py,sha256=DgMP_PWTfFO5J__q8bGxoT3ey5z727582wDD_u3UaPU,8307
|
@@ -126,13 +126,13 @@ streamlit/elements/widgets/time_widgets.py,sha256=AQGahztRpIALzJeJ8e-ZCPDyCj5xvn
|
|
126
126
|
streamlit/external/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
|
127
127
|
streamlit/external/langchain/__init__.py,sha256=sAzaNf4Cje3cJikPBVvF7pj1sEdEvUfKIEY_Z6Zk8cA,814
|
128
128
|
streamlit/external/langchain/streamlit_callback_handler.py,sha256=Q4RRYmYOj4zJjvM7aP8OCqSM7w9SHwfHP7dg9S0QGmA,15301
|
129
|
-
streamlit/hello/Animation_Demo.py,sha256=
|
130
|
-
streamlit/hello/Dataframe_Demo.py,sha256=
|
131
|
-
streamlit/hello/Hello.py,sha256=
|
132
|
-
streamlit/hello/Mapping_Demo.py,sha256=
|
133
|
-
streamlit/hello/Plotting_Demo.py,sha256=
|
129
|
+
streamlit/hello/Animation_Demo.py,sha256=iWkDHrhHhKITjkDv4qGcyR_aIpLyYmnZD8CzcuEyyb8,2971
|
130
|
+
streamlit/hello/Dataframe_Demo.py,sha256=zJdbGwhovc2SOXNRXSGRQfem9h5J5KCK136Be18TB4c,2539
|
131
|
+
streamlit/hello/Hello.py,sha256=Oya8ISBTpaykP7gAtGy_bGTCboW0E-5CAO31MLRlN74,1546
|
132
|
+
streamlit/hello/Mapping_Demo.py,sha256=iVTT5d2YYxCizbheSOjflsNY0ffvYLfV7cr_pXcmQec,3839
|
133
|
+
streamlit/hello/Plotting_Demo.py,sha256=w8Bgw5C4fjg0pTCRNLBNQ7wGBud2DAyBozE7HB-3B1E,1760
|
134
134
|
streamlit/hello/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
|
135
|
-
streamlit/hello/streamlit_app.py,sha256=
|
135
|
+
streamlit/hello/streamlit_app.py,sha256=3dsfcIZrYOSSMOtk7aA3tEBife7Jf8DJtlVIkwLRWTo,1214
|
136
136
|
streamlit/hello/utils.py,sha256=IZMM6MZ4tcrLuSN9RWmMEYlzTbbzA3trpq6Pa82NeRw,992
|
137
137
|
streamlit/navigation/__init__.py,sha256=Vrf1yVMOcTyhUPnYvsfyeL96Vpd5z8KoSV5ZzTcTQgU,616
|
138
138
|
streamlit/navigation/page.py,sha256=wSLDgNUN9vU6h971fO9pV5dxcAWjncG7IuC9WIG1LQo,11286
|
@@ -304,7 +304,7 @@ streamlit/runtime/media_file_storage.py,sha256=hQkMC__XRjshEUD73QCSrX3vrfOOO0U7V
|
|
304
304
|
streamlit/runtime/memory_media_file_storage.py,sha256=9jzWImu9qCUGbJ61c4UhkxRSAPvHLFxNdaPiICPKQtU,6277
|
305
305
|
streamlit/runtime/memory_session_storage.py,sha256=Tx-_3oUg6i9UokpBUIWvqhpWE0WmjtX764KdOzNvDMs,2940
|
306
306
|
streamlit/runtime/memory_uploaded_file_manager.py,sha256=rCLvdZv2nPlWeCiHnwV8phcVV43mUCgW7BaWkmEXgpM,4422
|
307
|
-
streamlit/runtime/metrics_util.py,sha256=
|
307
|
+
streamlit/runtime/metrics_util.py,sha256=4CVuaVhbFvXi0fZ3RhXbervriXaW5pkcmIOwxnh6Ltc,15231
|
308
308
|
streamlit/runtime/pages_manager.py,sha256=86GpkkRCNxRsgH-Kq10GLmjsTPgKX-ua42YfL8CsLq8,14123
|
309
309
|
streamlit/runtime/runtime.py,sha256=gUDK50PLzY3xdX1KpHeXM1nVTmtSmNtDPNYsccU7g-0,29334
|
310
310
|
streamlit/runtime/runtime_util.py,sha256=pPgc524cnmjVffZp_QuH3Yql8TFxuSs23gjnv7gIhqk,4021
|
@@ -538,9 +538,9 @@ streamlit/web/server/server_util.py,sha256=C3M971XFoEXTMufQLwHbZdtZOE30nWx-2WiXm
|
|
538
538
|
streamlit/web/server/stats_request_handler.py,sha256=47nQHe4ETsO9QS9FAEUF8rZigU_k5eACJZw4-jc8U6c,3684
|
539
539
|
streamlit/web/server/upload_file_request_handler.py,sha256=ftyKpARrUjOpRcFETIXuoTyOG_mo-ToOw5NI0y_W4lE,5003
|
540
540
|
streamlit/web/server/websocket_headers.py,sha256=xkmLm7-WyXyQM8fW-NuURBnD_rmQaiO3oBlu6woF71w,2207
|
541
|
-
streamlit_nightly-1.37.2.
|
542
|
-
streamlit_nightly-1.37.2.
|
543
|
-
streamlit_nightly-1.37.2.
|
544
|
-
streamlit_nightly-1.37.2.
|
545
|
-
streamlit_nightly-1.37.2.
|
546
|
-
streamlit_nightly-1.37.2.
|
541
|
+
streamlit_nightly-1.37.2.dev20240808.data/scripts/streamlit.cmd,sha256=ZEYM3vBJSp-k7vwSJ3ba5NzEk9-qHdSeLvGYAAe1mMw,676
|
542
|
+
streamlit_nightly-1.37.2.dev20240808.dist-info/METADATA,sha256=iveoGw9L8oNSFLECmWt8kGOqodtSF27vz50SkK2a82Q,8511
|
543
|
+
streamlit_nightly-1.37.2.dev20240808.dist-info/WHEEL,sha256=XRxW4r1PNiVhMpP4bT9oWtu3HyndxpJ84SkubFgzp_Y,109
|
544
|
+
streamlit_nightly-1.37.2.dev20240808.dist-info/entry_points.txt,sha256=uNJ4DwGNXEhOK0USwSNanjkYyR-Bk7eYQbJFDrWyOgY,53
|
545
|
+
streamlit_nightly-1.37.2.dev20240808.dist-info/top_level.txt,sha256=V3FhKbm7G2LnR0s4SytavrjIPNIhvcsAGXfYHAwtQzw,10
|
546
|
+
streamlit_nightly-1.37.2.dev20240808.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|