streamlit-nightly 1.36.1.dev20240620__py2.py3-none-any.whl → 1.36.1.dev20240622__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 CHANGED
@@ -77,8 +77,6 @@ from streamlit.runtime.caching import (
77
77
  cache_resource as _cache_resource,
78
78
  cache_data as _cache_data,
79
79
  cache as _cache,
80
- experimental_singleton as _experimental_singleton,
81
- experimental_memo as _experimental_memo,
82
80
  )
83
81
  from streamlit.runtime.connection_factory import (
84
82
  connection_factory as _connection,
@@ -113,7 +111,6 @@ from streamlit.commands.page_config import set_page_config as set_page_config
113
111
  from streamlit.commands.execution_control import (
114
112
  stop as stop,
115
113
  rerun as rerun,
116
- experimental_rerun as _experimental_rerun,
117
114
  switch_page as switch_page,
118
115
  )
119
116
 
@@ -239,11 +236,8 @@ connection = _connection
239
236
  # Experimental APIs
240
237
  experimental_dialog = _dialog_decorator
241
238
  experimental_fragment = _fragment
242
- experimental_memo = _experimental_memo
243
- experimental_singleton = _experimental_singleton
244
239
  experimental_user = _UserInfoProxy()
245
240
 
246
-
247
241
  _EXPERIMENTAL_QUERY_PARAMS_DEPRECATE_MSG = "Refer to our [docs page](https://docs.streamlit.io/develop/api-reference/caching-and-state/st.query_params) for more information."
248
242
 
249
243
  experimental_get_query_params = _deprecate_func_name(
@@ -260,11 +254,7 @@ experimental_set_query_params = _deprecate_func_name(
260
254
  _EXPERIMENTAL_QUERY_PARAMS_DEPRECATE_MSG,
261
255
  name_override="query_params",
262
256
  )
263
- experimental_rerun = _experimental_rerun
264
- experimental_data_editor = _main.experimental_data_editor
265
- experimental_connection = _deprecate_func_name(
266
- connection, "experimental_connection", "2024-04-01", name_override="connection"
267
- )
257
+
268
258
 
269
259
  # make it possible to call streamlit.components.v1.html etc. by importing it here
270
260
  # import in the very end to avoid partially-initialized module import errors, because
@@ -18,7 +18,6 @@ import os
18
18
  from typing import Final, NoReturn
19
19
 
20
20
  import streamlit as st
21
- from streamlit.deprecation_util import make_deprecated_name_warning
22
21
  from streamlit.errors import NoSessionContext, StreamlitAPIException
23
22
  from streamlit.file_util import get_main_script_directory, normalize_path_join
24
23
  from streamlit.logger import get_logger
@@ -85,22 +84,6 @@ def rerun() -> NoReturn: # type: ignore[misc]
85
84
  st.empty()
86
85
 
87
86
 
88
- @gather_metrics("experimental_rerun")
89
- def experimental_rerun() -> NoReturn:
90
- """Rerun the script immediately.
91
-
92
- When ``st.experimental_rerun()`` is called, the script is halted - no
93
- more statements will be run, and the script will be queued to re-run
94
- from the top.
95
- """
96
- msg = make_deprecated_name_warning("experimental_rerun", "rerun", "2024-04-01")
97
- # Log warning before the rerun, or else it would be interrupted
98
- # by the rerun. We do not send a frontend warning because it wouldn't
99
- # be seen.
100
- _LOGGER.warning(msg)
101
- rerun()
102
-
103
-
104
87
  @gather_metrics("switch_page")
105
88
  def switch_page(page: str | StreamlitPage) -> NoReturn: # type: ignore[misc]
106
89
  """Programmatically switch the current page in a multipage app.
@@ -39,7 +39,6 @@ from typing_extensions import TypeAlias
39
39
 
40
40
  from streamlit import logger as _logger
41
41
  from streamlit import type_util
42
- from streamlit.deprecation_util import deprecate_func_name
43
42
  from streamlit.elements.form import current_form_id
44
43
  from streamlit.elements.lib.column_config_utils import (
45
44
  INDEX_IDENTIFIER,
@@ -602,14 +601,6 @@ class DataEditorMixin:
602
601
 
603
602
  The data editor widget allows you to edit dataframes and many other data structures in a table-like UI.
604
603
 
605
- .. warning::
606
- When going from ``st.experimental_data_editor`` to ``st.data_editor`` in
607
- 1.23.0, the data editor's representation in ``st.session_state`` was changed.
608
- The ``edited_cells`` dictionary is now called ``edited_rows`` and uses a
609
- different format (``{0: {"column name": "edited value"}}`` instead of
610
- ``{"0:1": "edited value"}``). You may need to adjust the code if your app uses
611
- ``st.experimental_data_editor`` in combination with ``st.session_state``.
612
-
613
604
  Parameters
614
605
  ----------
615
606
  data : pandas.DataFrame, pandas.Series, pandas.Styler, pandas.Index, pyarrow.Table, numpy.ndarray, pyspark.sql.DataFrame, snowflake.snowpark.DataFrame, list, set, tuple, dict, or None
@@ -951,17 +942,3 @@ class DataEditorMixin:
951
942
  def dg(self) -> DeltaGenerator:
952
943
  """Get our DeltaGenerator."""
953
944
  return cast("DeltaGenerator", self)
954
-
955
- # TODO(lukasmasuch): Remove the deprecated function name after 2023-09-01:
956
- # Also remove the warning message in the `st.data_editor` docstring.
957
- experimental_data_editor = deprecate_func_name(
958
- gather_metrics("experimental_data_editor", data_editor),
959
- "experimental_data_editor",
960
- "2023-09-01",
961
- """
962
- **Breaking change:** The data editor's representation in `st.session_state` was changed. The `edited_cells` dictionary is now called `edited_rows` and uses a
963
- different format (`{0: {"column name": "edited value"}}` instead of
964
- `{"0:1": "edited value"}`). You may need to adjust the code if your app uses
965
- `st.experimental_data_editor` in combination with `st.session_state`."
966
- """,
967
- )
@@ -93,26 +93,6 @@ cache_resource = CacheResourceAPI(decorator_metric_name="cache_resource")
93
93
  # and it should be removed in the future.
94
94
  cache = _cache
95
95
 
96
- # Deprecated singletons
97
- _MEMO_WARNING = (
98
- f"`st.experimental_memo` is deprecated. Please use the new command `st.cache_data` instead, "
99
- f"which has the same behavior. More information [in our docs]({CACHE_DOCS_URL})."
100
- )
101
-
102
- experimental_memo = CacheDataAPI(
103
- decorator_metric_name="experimental_memo", deprecation_warning=_MEMO_WARNING
104
- )
105
-
106
- _SINGLETON_WARNING = (
107
- f"`st.experimental_singleton` is deprecated. Please use the new command `st.cache_resource` instead, "
108
- f"which has the same behavior. More information [in our docs]({CACHE_DOCS_URL})."
109
- )
110
-
111
- experimental_singleton = CacheResourceAPI(
112
- decorator_metric_name="experimental_singleton",
113
- deprecation_warning=_SINGLETON_WARNING,
114
- )
115
-
116
96
 
117
97
  __all__ = [
118
98
  "cache",
@@ -125,6 +105,4 @@ __all__ = [
125
105
  "get_resource_cache_stats_provider",
126
106
  "cache_data",
127
107
  "cache_resource",
128
- "experimental_memo",
129
- "experimental_singleton",
130
108
  ]
@@ -35,7 +35,6 @@ from typing_extensions import TypeAlias
35
35
 
36
36
  import streamlit as st
37
37
  from streamlit import runtime
38
- from streamlit.deprecation_util import show_deprecation_warning
39
38
  from streamlit.errors import StreamlitAPIException
40
39
  from streamlit.logger import get_logger
41
40
  from streamlit.runtime.caching.cache_errors import CacheError, CacheKeyNotFoundError
@@ -328,20 +327,13 @@ class CacheDataAPI:
328
327
  st.cache_data.clear().
329
328
  """
330
329
 
331
- def __init__(
332
- self, decorator_metric_name: str, deprecation_warning: str | None = None
333
- ):
330
+ def __init__(self, decorator_metric_name: str):
334
331
  """Create a CacheDataAPI instance.
335
332
 
336
333
  Parameters
337
334
  ----------
338
335
  decorator_metric_name
339
- The metric name to record for decorator usage. `@st.experimental_memo` is
340
- deprecated, but we're still supporting it and tracking its usage separately
341
- from `@st.cache_data`.
342
-
343
- deprecation_warning
344
- An optional deprecation warning to show when the API is accessed.
336
+ The metric name to record for decorator usage.
345
337
  """
346
338
 
347
339
  # Parameterize the decorator metric name.
@@ -349,7 +341,6 @@ class CacheDataAPI:
349
341
  self._decorator = gather_metrics( # type: ignore
350
342
  decorator_metric_name, self._decorator
351
343
  )
352
- self._deprecation_warning = deprecation_warning
353
344
 
354
345
  # Type-annotate the decorator function.
355
346
  # (See https://mypy.readthedocs.io/en/stable/generics.html#decorator-factories)
@@ -572,8 +563,6 @@ class CacheDataAPI:
572
563
  f"Unsupported persist option '{persist}'. Valid values are 'disk' or None."
573
564
  )
574
565
 
575
- self._maybe_show_deprecation_warning()
576
-
577
566
  if experimental_allow_widgets:
578
567
  show_widget_replay_deprecation("cache_data")
579
568
 
@@ -608,16 +597,8 @@ class CacheDataAPI:
608
597
  @gather_metrics("clear_data_caches")
609
598
  def clear(self) -> None:
610
599
  """Clear all in-memory and on-disk data caches."""
611
- self._maybe_show_deprecation_warning()
612
600
  _data_caches.clear_all()
613
601
 
614
- def _maybe_show_deprecation_warning(self):
615
- """If the API is being accessed with the deprecated `st.experimental_memo` name,
616
- show a deprecation warning.
617
- """
618
- if self._deprecation_warning is not None:
619
- show_deprecation_warning(self._deprecation_warning)
620
-
621
602
 
622
603
  class DataCache(Cache):
623
604
  """Manages cached values for a single st.cache_data function."""
@@ -25,7 +25,6 @@ from cachetools import TTLCache
25
25
  from typing_extensions import TypeAlias
26
26
 
27
27
  import streamlit as st
28
- from streamlit.deprecation_util import show_deprecation_warning
29
28
  from streamlit.logger import get_logger
30
29
  from streamlit.runtime.caching import cache_utils
31
30
  from streamlit.runtime.caching.cache_errors import CacheKeyNotFoundError
@@ -198,26 +197,18 @@ class CacheResourceAPI:
198
197
  and st.cache_resource.clear().
199
198
  """
200
199
 
201
- def __init__(
202
- self, decorator_metric_name: str, deprecation_warning: str | None = None
203
- ):
200
+ def __init__(self, decorator_metric_name: str):
204
201
  """Create a CacheResourceAPI instance.
205
202
 
206
203
  Parameters
207
204
  ----------
208
205
  decorator_metric_name
209
- The metric name to record for decorator usage. `@st.experimental_singleton` is
210
- deprecated, but we're still supporting it and tracking its usage separately
211
- from `@st.cache_resource`.
212
-
213
- deprecation_warning
214
- An optional deprecation warning to show when the API is accessed.
206
+ The metric name to record for decorator usage.
215
207
  """
216
208
 
217
209
  # Parameterize the decorator metric name.
218
210
  # (Ignore spurious mypy complaints - https://github.com/python/mypy/issues/2427)
219
211
  self._decorator = gather_metrics(decorator_metric_name, self._decorator) # type: ignore
220
- self._deprecation_warning = deprecation_warning
221
212
 
222
213
  # Type-annotate the decorator function.
223
214
  # (See https://mypy.readthedocs.io/en/stable/generics.html#decorator-factories)
@@ -422,8 +413,6 @@ class CacheResourceAPI:
422
413
  ... def get_person_name(person: Person):
423
414
  ... return person.name
424
415
  """
425
- self._maybe_show_deprecation_warning()
426
-
427
416
  if experimental_allow_widgets:
428
417
  show_widget_replay_deprecation("cache_resource")
429
418
 
@@ -457,16 +446,8 @@ class CacheResourceAPI:
457
446
  @gather_metrics("clear_resource_caches")
458
447
  def clear(self) -> None:
459
448
  """Clear all cache_resource caches."""
460
- self._maybe_show_deprecation_warning()
461
449
  _resource_caches.clear_all()
462
450
 
463
- def _maybe_show_deprecation_warning(self):
464
- """If the API is being accessed with the deprecated `st.experimental_singleton` name,
465
- show a deprecation warning.
466
- """
467
- if self._deprecation_warning is not None:
468
- show_deprecation_warning(self._deprecation_warning)
469
-
470
451
 
471
452
  class ResourceCache(Cache):
472
453
  """Manages cached values for a single st.cache_resource function."""
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.3aaaea00.css",
4
- "main.js": "./static/js/main.ba32d829.js",
4
+ "main.js": "./static/js/main.5b854b9d.js",
5
5
  "static/js/9336.3e046ad7.chunk.js": "./static/js/9336.3e046ad7.chunk.js",
6
6
  "static/js/9330.2b4c99e0.chunk.js": "./static/js/9330.2b4c99e0.chunk.js",
7
7
  "static/js/2736.4336e2b9.chunk.js": "./static/js/2736.4336e2b9.chunk.js",
@@ -151,6 +151,6 @@
151
151
  },
152
152
  "entrypoints": [
153
153
  "static/css/main.3aaaea00.css",
154
- "static/js/main.ba32d829.js"
154
+ "static/js/main.5b854b9d.js"
155
155
  ]
156
156
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.ba32d829.js"></script><link href="./static/css/main.3aaaea00.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><link rel="shortcut icon" href="./favicon.png"/><link rel="preload" href="./static/media/SourceSansPro-Regular.0d69e5ff5e92ac64a0c9.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-SemiBold.abed79cd0df1827e18cf.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="./static/media/SourceSansPro-Bold.118dea98980e20a81ced.woff2" as="font" type="font/woff2" crossorigin><title>Streamlit</title><script>window.prerenderReady=!1</script><script defer="defer" src="./static/js/main.5b854b9d.js"></script><link href="./static/css/main.3aaaea00.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>