streamlit-nightly 1.46.1.dev20250625__py3-none-any.whl → 1.46.2.dev20250627__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 +1 -1
- streamlit/elements/dialog_decorator.py +18 -1
- streamlit/elements/lib/column_types.py +7 -0
- streamlit/runtime/caching/cache_data_api.py +29 -10
- streamlit/runtime/caching/cache_resource_api.py +40 -13
- streamlit/static/index.html +1 -1
- streamlit/static/manifest.json +214 -214
- streamlit/static/static/js/{ErrorOutline.esm.Ca4_C74G.js → ErrorOutline.esm.Cks_iIQ-.js} +1 -1
- streamlit/static/static/js/{FileDownload.esm.BEXpx-NN.js → FileDownload.esm.BgAcJaBJ.js} +1 -1
- streamlit/static/static/js/{FileHelper.B4GGzKqK.js → FileHelper.BnEW9df2.js} +1 -1
- streamlit/static/static/js/{FormClearHelper.CpsBciie.js → FormClearHelper.D7ijm88e.js} +1 -1
- streamlit/static/static/js/{Hooks.DsIXUDOP.js → Hooks.BX9mvLIz.js} +1 -1
- streamlit/static/static/js/{InputInstructions.Dh8ccyYH.js → InputInstructions.B061yGr2.js} +1 -1
- streamlit/static/static/js/{ProgressBar.C57HogTe.js → ProgressBar.B8o6s3Fj.js} +2 -2
- streamlit/static/static/js/RenderInPortalIfExists.zrlVZ4c5.js +1 -0
- streamlit/static/static/js/{Toolbar.BZBwHk6r.js → Toolbar.BZVTYNtL.js} +1 -1
- streamlit/static/static/js/{base-input.C3m059Ja.js → base-input.CyVEPdgQ.js} +4 -4
- streamlit/static/static/js/{checkbox.Bz1HY8hS.js → checkbox.CRhx-utT.js} +2 -2
- streamlit/static/static/js/{createSuper.BgXZoFPR.js → createSuper.Bk9wC4ER.js} +1 -1
- streamlit/static/static/js/{data-grid-overlay-editor.DHAXzOWr.js → data-grid-overlay-editor.MrRy2pCu.js} +1 -1
- streamlit/static/static/js/{downloader.DXmvN319.js → downloader.BYHNjIU7.js} +1 -1
- streamlit/static/static/js/{es6.Dg-Jfu-r.js → es6.C9naygo8.js} +2 -2
- streamlit/static/static/js/{iframeResizer.contentWindow.BqWlTWPM.js → iframeResizer.contentWindow.Cgux768F.js} +1 -1
- streamlit/static/static/js/index.3HBQ7wiY.js +1 -0
- streamlit/static/static/js/{index.D6NDAr7R.js → index.B3id1usU.js} +1 -1
- streamlit/static/static/js/{index.BEHais2d.js → index.B6LxYHzZ.js} +26 -26
- streamlit/static/static/js/{index.Q4yOipZt.js → index.B9spSuBT.js} +3 -3
- streamlit/static/static/js/index.BADE2QoA.js +1 -0
- streamlit/static/static/js/{index.Bpq_TVP8.js → index.C2UhBdvP.js} +1 -1
- streamlit/static/static/js/{index.B5HCKYGs.js → index.C3nUHooR.js} +2 -2
- streamlit/static/static/js/{index.C8kJiudO.js → index.CLaq4cdk.js} +1 -1
- streamlit/static/static/js/{index.wwMXYz4o.js → index.Cc4FAECZ.js} +1 -1
- streamlit/static/static/js/{index.BSduVAl-.js → index.Cd-LN-s-.js} +1 -1
- streamlit/static/static/js/{index.BgcFXG8Y.js → index.CiWX70v4.js} +1 -1
- streamlit/static/static/js/{index.CF7xf0Kc.js → index.Cwvx-QoM.js} +56 -56
- streamlit/static/static/js/{index.BgoLThsY.js → index.CzuG6mLu.js} +1 -1
- streamlit/static/static/js/{index.BqfEAvp0.js → index.D2ME4K6X.js} +1 -1
- streamlit/static/static/js/{index.CWNrL7gF.js → index.D8vt63yR.js} +1 -1
- streamlit/static/static/js/{index.B_GGKi7h.js → index.DDE_qn3B.js} +1 -1
- streamlit/static/static/js/index.DL_oa8C0.js +1 -0
- streamlit/static/static/js/index.DXfo01u0.js +1 -0
- streamlit/static/static/js/index.DeT0wkqD.js +7 -0
- streamlit/static/static/js/{index.DyESyaCa.js → index.DfztRPXA.js} +1 -1
- streamlit/static/static/js/{index.CuNbzfuD.js → index.Dg-jjU76.js} +1 -1
- streamlit/static/static/js/index.DhGfGsU3.js +1 -0
- streamlit/static/static/js/{index.Cob2CEOY.js → index.DviG-qYx.js} +2 -2
- streamlit/static/static/js/{index.CLutgZmA.js → index.IIwl5O7d.js} +2 -2
- streamlit/static/static/js/{index.C-C4puTW.js → index.KALUdsxF.js} +1 -1
- streamlit/static/static/js/{index.04JkG8Km.js → index.M9A8egHW.js} +1 -1
- streamlit/static/static/js/{index.1o7GFmH9.js → index.VifayNUS.js} +1 -1
- streamlit/static/static/js/{index.C6WBb5UI.js → index.WJ3tVQmL.js} +1 -1
- streamlit/static/static/js/{index.CIgyykei.js → index.Z-4rNNaK.js} +1 -1
- streamlit/static/static/js/{index.D_AaeKaM.js → index.ZAf2vwk7.js} +1 -1
- streamlit/static/static/js/{index.DPwE86ME.js → index._x4HsVMV.js} +2 -2
- streamlit/static/static/js/{index.D8Opklrn.js → index.g2lYLp_A.js} +1 -1
- streamlit/static/static/js/index.j4w6sPCZ.js +1 -0
- streamlit/static/static/js/index.jfPujl89.js +1 -0
- streamlit/static/static/js/{index.CL0g79ua.js → index.k-bbYdd8.js} +1 -1
- streamlit/static/static/js/{index.C9-NSIWy.js → index.n0Ha_TOu.js} +1 -1
- streamlit/static/static/js/{index.DkawoLEN.js → index.slS1KXaf.js} +1 -1
- streamlit/static/static/js/{input.G0_SQaLD.js → input.DfJ_j9Zd.js} +1 -1
- streamlit/static/static/js/{memory.B6tpNh1r.js → memory.CI4kaYtj.js} +1 -1
- streamlit/static/static/js/{mergeWith.BIMOGvX0.js → mergeWith.DbOkulfP.js} +1 -1
- streamlit/static/static/js/{number-overlay-editor.BGVzFv7I.js → number-overlay-editor.Cp9ebTmd.js} +1 -1
- streamlit/static/static/js/{possibleConstructorReturn.Bk9dXD1L.js → possibleConstructorReturn.BYPlFU5H.js} +1 -1
- streamlit/static/static/js/{sandbox.DWWQ1lBu.js → sandbox.DExttQ30.js} +1 -1
- streamlit/static/static/js/{textarea.FHoad42C.js → textarea.C5Hyturk.js} +2 -2
- streamlit/static/static/js/{timepicker.yc5xqDUF.js → timepicker.CP7Wc6O3.js} +4 -4
- streamlit/static/static/js/{toConsumableArray.DfbSd22b.js → toConsumableArray.BxDw_yrK.js} +1 -1
- streamlit/static/static/js/{uniqueId.C03hvAF0.js → uniqueId.CyNBI7Dy.js} +1 -1
- streamlit/static/static/js/{useBasicWidgetState.DxtD7xs-.js → useBasicWidgetState.DmazR4LK.js} +1 -1
- streamlit/static/static/js/{useOnInputChange.DqPkFylT.js → useOnInputChange.DdotEGIu.js} +1 -1
- streamlit/static/static/js/{withFullScreenWrapper.CAwHwFP9.js → withFullScreenWrapper.C9oKRHHU.js} +1 -1
- streamlit/web/server/server.py +3 -1
- streamlit/web/server/server_util.py +24 -0
- {streamlit_nightly-1.46.1.dev20250625.dist-info → streamlit_nightly-1.46.2.dev20250627.dist-info}/METADATA +1 -1
- {streamlit_nightly-1.46.1.dev20250625.dist-info → streamlit_nightly-1.46.2.dev20250627.dist-info}/RECORD +81 -81
- streamlit/static/static/js/RenderInPortalIfExists.JT5A_75h.js +0 -1
- streamlit/static/static/js/index.B-IWkE_m.js +0 -7
- streamlit/static/static/js/index.BUpHFScA.js +0 -1
- streamlit/static/static/js/index.CxdFkXN7.js +0 -1
- streamlit/static/static/js/index.DSVau5_M.js +0 -1
- streamlit/static/static/js/index.De84gVwH.js +0 -1
- streamlit/static/static/js/index.PYYOff5g.js +0 -1
- streamlit/static/static/js/index.lctgkaZQ.js +0 -1
- streamlit/static/static/js/index.tO_5FrTQ.js +0 -1
- {streamlit_nightly-1.46.1.dev20250625.data → streamlit_nightly-1.46.2.dev20250627.data}/scripts/streamlit.cmd +0 -0
- {streamlit_nightly-1.46.1.dev20250625.dist-info → streamlit_nightly-1.46.2.dev20250627.dist-info}/WHEEL +0 -0
- {streamlit_nightly-1.46.1.dev20250625.dist-info → streamlit_nightly-1.46.2.dev20250627.dist-info}/entry_points.txt +0 -0
- {streamlit_nightly-1.46.1.dev20250625.dist-info → streamlit_nightly-1.46.2.dev20250627.dist-info}/top_level.txt +0 -0
streamlit/__init__.py
CHANGED
@@ -134,7 +134,7 @@ def dialog_decorator(title: F, *, width: DialogWidth = "small") -> F: ...
|
|
134
134
|
def dialog_decorator(
|
135
135
|
title: F | str, *, width: DialogWidth = "small"
|
136
136
|
) -> F | Callable[[F], F]:
|
137
|
-
"""Function decorator to create a modal dialog.
|
137
|
+
r"""Function decorator to create a modal dialog.
|
138
138
|
|
139
139
|
A function decorated with ``@st.dialog`` becomes a dialog
|
140
140
|
function. When you call a dialog function, Streamlit inserts a modal dialog
|
@@ -173,6 +173,23 @@ def dialog_decorator(
|
|
173
173
|
----------
|
174
174
|
title : str
|
175
175
|
The title to display at the top of the modal dialog. It cannot be empty.
|
176
|
+
|
177
|
+
The title can optionally contain GitHub-flavored Markdown of the
|
178
|
+
following types: Bold, Italics, Strikethroughs, Inline Code, Links,
|
179
|
+
and Images. Images display like icons, with a max height equal to
|
180
|
+
the font height.
|
181
|
+
|
182
|
+
Unsupported Markdown elements are unwrapped so only their children
|
183
|
+
(text contents) render. Display unsupported elements as literal
|
184
|
+
characters by backslash-escaping them. E.g.,
|
185
|
+
``"1\. Not an ordered list"``.
|
186
|
+
|
187
|
+
See the ``body`` parameter of |st.markdown|_ for additional,
|
188
|
+
supported Markdown directives.
|
189
|
+
|
190
|
+
.. |st.markdown| replace:: ``st.markdown``
|
191
|
+
.. _st.markdown: https://docs.streamlit.io/develop/api-reference/text/st.markdown
|
192
|
+
|
176
193
|
width : "small", "large"
|
177
194
|
The width of the modal dialog. If ``width`` is ``"small`` (default), the
|
178
195
|
modal dialog will be 500 pixels wide. If ``width`` is ``"large"``, the
|
@@ -23,6 +23,7 @@ from typing import TYPE_CHECKING, Literal, TypedDict
|
|
23
23
|
from typing_extensions import NotRequired, TypeAlias
|
24
24
|
|
25
25
|
from streamlit.runtime.metrics_util import gather_metrics
|
26
|
+
from streamlit.string_util import validate_material_icon
|
26
27
|
|
27
28
|
if TYPE_CHECKING:
|
28
29
|
from collections.abc import Iterable
|
@@ -38,6 +39,7 @@ NumberFormat: TypeAlias = Literal[
|
|
38
39
|
"scientific",
|
39
40
|
"engineering",
|
40
41
|
"accounting",
|
42
|
+
"bytes",
|
41
43
|
]
|
42
44
|
|
43
45
|
ColumnWidth: TypeAlias = Literal["small", "medium", "large"]
|
@@ -429,6 +431,7 @@ def NumberColumn(
|
|
429
431
|
- ``"euro"``: Show the number as a euro amount (e.g. "€1,234.57").
|
430
432
|
- ``"yen"``: Show the number as a yen amount (e.g. "¥1,235").
|
431
433
|
- ``"accounting"``: Show the number in an accounting format (e.g. "1,234.00").
|
434
|
+
- ``"bytes"``: Show the number in a byte format (e.g. "1.2KB").
|
432
435
|
- ``"compact"``: Show the number in a compact format (e.g. "1.2K").
|
433
436
|
- ``"scientific"``: Show the number in scientific notation (e.g. "1.235E3").
|
434
437
|
- ``"engineering"``: Show the number in engineering notation (e.g. "1.235E3").
|
@@ -711,6 +714,7 @@ def LinkColumn(
|
|
711
714
|
|
712
715
|
- ``None`` (default) to display the URL itself.
|
713
716
|
- A string that is displayed in every cell, e.g. ``"Open link"``.
|
717
|
+
- A material icon displayed in every cell, e.g. ``":material/open_in_new:"``
|
714
718
|
- A JS-flavored regular expression (detected by usage of parentheses)
|
715
719
|
to extract a part of the URL via a capture group. For example, use
|
716
720
|
``"https://(.*?)\.example\.com"`` to extract the display text
|
@@ -768,6 +772,8 @@ def LinkColumn(
|
|
768
772
|
https://doc-link-column.streamlit.app/
|
769
773
|
height: 300px
|
770
774
|
"""
|
775
|
+
if display_text and display_text.startswith(":material/"):
|
776
|
+
display_text = validate_material_icon(display_text)
|
771
777
|
|
772
778
|
return ColumnConfig(
|
773
779
|
label=label,
|
@@ -2005,6 +2011,7 @@ def ProgressColumn(
|
|
2005
2011
|
- ``"euro"``: Show the number as a euro amount (e.g. "€1,234.57").
|
2006
2012
|
- ``"yen"``: Show the number as a yen amount (e.g. "¥1,235").
|
2007
2013
|
- ``"accounting"``: Show the number in an accounting format (e.g. "1,234.00").
|
2014
|
+
- ``"bytes"``: Show the number in a byte format (e.g. "1.2KB").
|
2008
2015
|
- ``"compact"``: Show the number in a compact format (e.g. "1.2K").
|
2009
2016
|
- ``"scientific"``: Show the number in scientific notation (e.g. "1.235E3").
|
2010
2017
|
- ``"engineering"``: Show the number in engineering notation (e.g. "1.235E3").
|
@@ -24,13 +24,14 @@ from typing import (
|
|
24
24
|
Callable,
|
25
25
|
Final,
|
26
26
|
Literal,
|
27
|
+
Protocol,
|
27
28
|
TypeVar,
|
28
29
|
Union,
|
29
30
|
cast,
|
30
31
|
overload,
|
31
32
|
)
|
32
33
|
|
33
|
-
from typing_extensions import TypeAlias
|
34
|
+
from typing_extensions import ParamSpec, TypeAlias
|
34
35
|
|
35
36
|
import streamlit as st
|
36
37
|
from streamlit import runtime
|
@@ -318,7 +319,25 @@ def get_data_cache_stats_provider() -> CacheStatsProvider:
|
|
318
319
|
|
319
320
|
# Type-annotate the decorator function.
|
320
321
|
# (See https://mypy.readthedocs.io/en/stable/generics.html#decorator-factories)
|
321
|
-
|
322
|
+
P = ParamSpec("P")
|
323
|
+
T_co = TypeVar("T_co", covariant=True)
|
324
|
+
|
325
|
+
|
326
|
+
class CachedFunc(Protocol[P, T_co]):
|
327
|
+
"""Protocol for cached functions that preserve the original function's signature and add a clear method."""
|
328
|
+
|
329
|
+
def __call__(self, *args: P.args, **kwargs: P.kwargs) -> T_co: ...
|
330
|
+
|
331
|
+
@overload
|
332
|
+
def clear(self) -> None: ...
|
333
|
+
|
334
|
+
@overload
|
335
|
+
def clear(self, *args: P.args, **kwargs: P.kwargs) -> None: ...
|
336
|
+
|
337
|
+
# Currently we can't define the "all-optional" argument overload with `P.args` and `P.kwargs` in Python.
|
338
|
+
# So we use `Any` as a fallback.
|
339
|
+
@overload
|
340
|
+
def clear(self, *args: Any, **kwargs: Any) -> None: ...
|
322
341
|
|
323
342
|
|
324
343
|
class CacheDataAPI:
|
@@ -343,7 +362,7 @@ class CacheDataAPI:
|
|
343
362
|
|
344
363
|
# Bare decorator usage
|
345
364
|
@overload
|
346
|
-
def __call__(self, func:
|
365
|
+
def __call__(self, func: Callable[P, T_co]) -> CachedFunc[P, T_co]: ...
|
347
366
|
|
348
367
|
# Decorator with arguments
|
349
368
|
@overload
|
@@ -356,11 +375,11 @@ class CacheDataAPI:
|
|
356
375
|
persist: CachePersistType | bool = None,
|
357
376
|
experimental_allow_widgets: bool = False,
|
358
377
|
hash_funcs: HashFuncsDict | None = None,
|
359
|
-
) -> Callable[[
|
378
|
+
) -> Callable[[Callable[P, T_co]], CachedFunc[P, T_co]]: ...
|
360
379
|
|
361
380
|
def __call__(
|
362
381
|
self,
|
363
|
-
func:
|
382
|
+
func: Callable[P, T_co] | None = None,
|
364
383
|
*,
|
365
384
|
ttl: float | timedelta | str | None = None,
|
366
385
|
max_entries: int | None = None,
|
@@ -368,7 +387,7 @@ class CacheDataAPI:
|
|
368
387
|
persist: CachePersistType | bool = None,
|
369
388
|
experimental_allow_widgets: bool = False,
|
370
389
|
hash_funcs: HashFuncsDict | None = None,
|
371
|
-
) ->
|
390
|
+
) -> CachedFunc[P, T_co] | Callable[[Callable[P, T_co]], CachedFunc[P, T_co]]:
|
372
391
|
return self._decorator(
|
373
392
|
func,
|
374
393
|
ttl=ttl,
|
@@ -381,7 +400,7 @@ class CacheDataAPI:
|
|
381
400
|
|
382
401
|
def _decorator(
|
383
402
|
self,
|
384
|
-
func:
|
403
|
+
func: Callable[P, T_co] | None = None,
|
385
404
|
*,
|
386
405
|
ttl: float | timedelta | str | None,
|
387
406
|
max_entries: int | None,
|
@@ -389,7 +408,7 @@ class CacheDataAPI:
|
|
389
408
|
persist: CachePersistType | bool,
|
390
409
|
experimental_allow_widgets: bool,
|
391
410
|
hash_funcs: HashFuncsDict | None = None,
|
392
|
-
) ->
|
411
|
+
) -> CachedFunc[P, T_co] | Callable[[Callable[P, T_co]], CachedFunc[P, T_co]]:
|
393
412
|
"""Decorator to cache functions that return data (e.g. dataframe transforms, database queries, ML inference).
|
394
413
|
|
395
414
|
Cached objects are stored in "pickled" form, which means that the return
|
@@ -567,9 +586,9 @@ class CacheDataAPI:
|
|
567
586
|
if experimental_allow_widgets:
|
568
587
|
show_widget_replay_deprecation("cache_data")
|
569
588
|
|
570
|
-
def wrapper(f:
|
589
|
+
def wrapper(f: Callable[P, T_co]) -> CachedFunc[P, T_co]:
|
571
590
|
return cast(
|
572
|
-
"
|
591
|
+
"CachedFunc[P, T_co]",
|
573
592
|
make_cached_func_wrapper(
|
574
593
|
CachedDataFuncInfo(
|
575
594
|
func=f, # type: ignore
|
@@ -18,10 +18,19 @@ from __future__ import annotations
|
|
18
18
|
|
19
19
|
import math
|
20
20
|
import threading
|
21
|
-
from typing import
|
21
|
+
from typing import (
|
22
|
+
TYPE_CHECKING,
|
23
|
+
Any,
|
24
|
+
Callable,
|
25
|
+
Final,
|
26
|
+
Protocol,
|
27
|
+
TypeVar,
|
28
|
+
cast,
|
29
|
+
overload,
|
30
|
+
)
|
22
31
|
|
23
32
|
from cachetools import TTLCache
|
24
|
-
from typing_extensions import TypeAlias
|
33
|
+
from typing_extensions import ParamSpec, TypeAlias
|
25
34
|
|
26
35
|
import streamlit as st
|
27
36
|
from streamlit.logger import get_logger
|
@@ -184,6 +193,29 @@ class CachedResourceFuncInfo(CachedFuncInfo):
|
|
184
193
|
)
|
185
194
|
|
186
195
|
|
196
|
+
# Type-annotate the decorator function.
|
197
|
+
# (See https://mypy.readthedocs.io/en/stable/generics.html#decorator-factories)
|
198
|
+
P = ParamSpec("P")
|
199
|
+
T_co = TypeVar("T_co", covariant=True)
|
200
|
+
|
201
|
+
|
202
|
+
class CachedFunc(Protocol[P, T_co]):
|
203
|
+
"""Protocol for cached functions that preserve the original function's signature and add a clear method."""
|
204
|
+
|
205
|
+
def __call__(self, *args: P.args, **kwargs: P.kwargs) -> T_co: ...
|
206
|
+
|
207
|
+
@overload
|
208
|
+
def clear(self) -> None: ...
|
209
|
+
|
210
|
+
@overload
|
211
|
+
def clear(self, *args: P.args, **kwargs: P.kwargs) -> None: ...
|
212
|
+
|
213
|
+
# Currently we can't define the "all-optional" argument overload with `P.args` and `P.kwargs` in Python.
|
214
|
+
# So we use `Any` as a fallback.
|
215
|
+
@overload
|
216
|
+
def clear(self, *args: Any, **kwargs: Any) -> None: ...
|
217
|
+
|
218
|
+
|
187
219
|
class CacheResourceAPI:
|
188
220
|
"""Implements the public st.cache_resource API: the @st.cache_resource decorator,
|
189
221
|
and st.cache_resource.clear().
|
@@ -202,14 +234,9 @@ class CacheResourceAPI:
|
|
202
234
|
# (Ignore spurious mypy complaints - https://github.com/python/mypy/issues/2427)
|
203
235
|
self._decorator = gather_metrics(decorator_metric_name, self._decorator) # type: ignore
|
204
236
|
|
205
|
-
# Type-annotate the decorator function.
|
206
|
-
# (See https://mypy.readthedocs.io/en/stable/generics.html#decorator-factories)
|
207
|
-
|
208
|
-
F = TypeVar("F", bound=Callable[..., Any])
|
209
|
-
|
210
237
|
# Bare decorator usage
|
211
238
|
@overload
|
212
|
-
def __call__(self, func:
|
239
|
+
def __call__(self, func: Callable[P, T_co]) -> CachedFunc[P, T_co]: ...
|
213
240
|
|
214
241
|
# Decorator with arguments
|
215
242
|
@overload
|
@@ -222,11 +249,11 @@ class CacheResourceAPI:
|
|
222
249
|
validate: ValidateFunc | None = None,
|
223
250
|
experimental_allow_widgets: bool = False,
|
224
251
|
hash_funcs: HashFuncsDict | None = None,
|
225
|
-
) -> Callable[[
|
252
|
+
) -> Callable[[Callable[P, T_co]], CachedFunc[P, T_co]]: ...
|
226
253
|
|
227
254
|
def __call__(
|
228
255
|
self,
|
229
|
-
func:
|
256
|
+
func: Callable[P, T_co] | None = None,
|
230
257
|
*,
|
231
258
|
ttl: float | timedelta | str | None = None,
|
232
259
|
max_entries: int | None = None,
|
@@ -234,7 +261,7 @@ class CacheResourceAPI:
|
|
234
261
|
validate: ValidateFunc | None = None,
|
235
262
|
experimental_allow_widgets: bool = False,
|
236
263
|
hash_funcs: HashFuncsDict | None = None,
|
237
|
-
) ->
|
264
|
+
) -> CachedFunc[P, T_co] | Callable[[Callable[P, T_co]], CachedFunc[P, T_co]]:
|
238
265
|
return self._decorator(
|
239
266
|
func,
|
240
267
|
ttl=ttl,
|
@@ -247,7 +274,7 @@ class CacheResourceAPI:
|
|
247
274
|
|
248
275
|
def _decorator(
|
249
276
|
self,
|
250
|
-
func:
|
277
|
+
func: Callable[P, T_co] | None,
|
251
278
|
*,
|
252
279
|
ttl: float | timedelta | str | None,
|
253
280
|
max_entries: int | None,
|
@@ -255,7 +282,7 @@ class CacheResourceAPI:
|
|
255
282
|
validate: ValidateFunc | None,
|
256
283
|
experimental_allow_widgets: bool,
|
257
284
|
hash_funcs: HashFuncsDict | None = None,
|
258
|
-
) ->
|
285
|
+
) -> CachedFunc[P, T_co] | Callable[[Callable[P, T_co]], CachedFunc[P, T_co]]:
|
259
286
|
"""Decorator to cache functions that return global resources (e.g. database connections, ML models).
|
260
287
|
|
261
288
|
Cached objects are shared across all users, sessions, and reruns. They
|
streamlit/static/index.html
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
<script>
|
38
38
|
window.prerenderReady = false
|
39
39
|
</script>
|
40
|
-
<script type="module" crossorigin src="./static/js/index.
|
40
|
+
<script type="module" crossorigin src="./static/js/index.B6LxYHzZ.js"></script>
|
41
41
|
<link rel="stylesheet" crossorigin href="./static/css/index.CJVRHjQZ.css">
|
42
42
|
</head>
|
43
43
|
<body>
|