streamlit-nightly 1.46.2.dev20250626__py3-none-any.whl → 1.46.2.dev20250628__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. streamlit/__init__.py +1 -1
  2. streamlit/config.py +37 -0
  3. streamlit/proto/NewSession_pb2.py +16 -16
  4. streamlit/proto/NewSession_pb2.pyi +5 -1
  5. streamlit/runtime/app_session.py +30 -1
  6. streamlit/runtime/caching/cache_data_api.py +29 -10
  7. streamlit/runtime/caching/cache_resource_api.py +40 -13
  8. streamlit/static/index.html +1 -1
  9. streamlit/static/manifest.json +218 -218
  10. streamlit/static/static/js/{ErrorOutline.esm.CJg-nD07.js → ErrorOutline.esm.DOv-m0Tq.js} +1 -1
  11. streamlit/static/static/js/{FileDownload.esm.Bqu9hYVK.js → FileDownload.esm.BJq4sORP.js} +1 -1
  12. streamlit/static/static/js/{FileHelper.BTD8--nH.js → FileHelper.BQaFP--d.js} +1 -1
  13. streamlit/static/static/js/{FormClearHelper.DwQzHDKa.js → FormClearHelper.BNPZlucK.js} +1 -1
  14. streamlit/static/static/js/{Hooks.CkgvOw3a.js → Hooks.BbsB0tft.js} +1 -1
  15. streamlit/static/static/js/{InputInstructions.A_59uy0m.js → InputInstructions.Bn7SfmZQ.js} +1 -1
  16. streamlit/static/static/js/{ProgressBar.B8wHlmHP.js → ProgressBar.VamAi00S.js} +1 -1
  17. streamlit/static/static/js/RenderInPortalIfExists.BMcofnFR.js +1 -0
  18. streamlit/static/static/js/{Toolbar.CTXCF-zE.js → Toolbar.D07m35gs.js} +1 -1
  19. streamlit/static/static/js/{base-input.DLahFrJX.js → base-input.CRDju-EK.js} +4 -4
  20. streamlit/static/static/js/{checkbox.BqH30Pie.js → checkbox.CHb2GSpC.js} +2 -2
  21. streamlit/static/static/js/{createSuper.BR6dNcL_.js → createSuper.CoSOeLpp.js} +1 -1
  22. streamlit/static/static/js/{data-grid-overlay-editor.DHD2lEOv.js → data-grid-overlay-editor.Dn5QYucy.js} +1 -1
  23. streamlit/static/static/js/{downloader.Cxz7Pmav.js → downloader.CMEM6V2v.js} +1 -1
  24. streamlit/static/static/js/{es6.CKIqaUkI.js → es6.KKrSqGPC.js} +2 -2
  25. streamlit/static/static/js/{iframeResizer.contentWindow.BUR39Ca8.js → iframeResizer.contentWindow.s9tHKC5N.js} +1 -1
  26. streamlit/static/static/js/{index.d0pgY8V8.js → index.-dLnClVh.js} +1 -1
  27. streamlit/static/static/js/{index.C8wAT-1P.js → index.31-60MG1.js} +16 -16
  28. streamlit/static/static/js/index.B-Fi5URX.js +1 -0
  29. streamlit/static/static/js/index.BF31vT9W.js +1 -0
  30. streamlit/static/static/js/{index.jk8Nloxj.js → index.BOpIRvhB.js} +1 -1
  31. streamlit/static/static/js/{index.C0sFxtmT.js → index.BRFEii3y.js} +1 -1
  32. streamlit/static/static/js/{index.D5Bi0_IY.js → index.Be15MzB3.js} +1 -1
  33. streamlit/static/static/js/{index.BydvTht8.js → index.CA6X3n1h.js} +2 -2
  34. streamlit/static/static/js/{index.CxswEeN7.js → index.CK0LK9uo.js} +1 -1
  35. streamlit/static/static/js/index.CKTcU2Jo.js +7 -0
  36. streamlit/static/static/js/{index.DoCkeB4S.js → index.CQoPrcao.js} +1 -1
  37. streamlit/static/static/js/{index.Du_GhChx.js → index.CSMFgqFx.js} +78 -78
  38. streamlit/static/static/js/{index.5WfC2MKX.js → index.C_KOPhLq.js} +2 -2
  39. streamlit/static/static/js/{index.0RieWGP-.js → index.CmssQLKG.js} +1 -1
  40. streamlit/static/static/js/{index.BnPGYwJD.js → index.CuJ7aHek.js} +1 -1
  41. streamlit/static/static/js/{index._udMrZfX.js → index.Cw62yKYR.js} +1 -1
  42. streamlit/static/static/js/{index.Cx9oo677.js → index.CwsRQuWC.js} +1 -1
  43. streamlit/static/static/js/index.D-ZjhsnF.js +1 -0
  44. streamlit/static/static/js/{index.DFLLK5fQ.js → index.D1qmtSYC.js} +1 -1
  45. streamlit/static/static/js/{index.BvMYFCGi.js → index.D4KBbzF-.js} +1 -1
  46. streamlit/static/static/js/{index.Ched5ljK.js → index.D5kLs5xY.js} +1 -1
  47. streamlit/static/static/js/index.DAfRod-A.js +1 -0
  48. streamlit/static/static/js/{index.YJxN7uL8.js → index.DGAM0SUk.js} +1 -1
  49. streamlit/static/static/js/index.DH_lrk03.js +1 -0
  50. streamlit/static/static/js/{index.B5TjHKHs.js → index.DKRFgERo.js} +1 -1
  51. streamlit/static/static/js/{index.CF_0T827.js → index.DZ9mRqRM.js} +1 -1
  52. streamlit/static/static/js/{index.dRZ6j1EM.js → index.DZfNCrwB.js} +2 -2
  53. streamlit/static/static/js/index.Ddt-yti9.js +1 -0
  54. streamlit/static/static/js/{index.5T0ZQUll.js → index.DjzdbuRp.js} +1 -1
  55. streamlit/static/static/js/{index.C46vZAVk.js → index.Dm2kLKvF.js} +2 -2
  56. streamlit/static/static/js/index.Dp7v49xb.js +1 -0
  57. streamlit/static/static/js/{index.DaVYWs29.js → index.IjtuElHJ.js} +1 -1
  58. streamlit/static/static/js/{index.Br9KoWfK.js → index.OVsenoDa.js} +1 -1
  59. streamlit/static/static/js/index.QFcvHrXB.js +1 -0
  60. streamlit/static/static/js/{index.NIVZIka1.js → index.dgrTv8XT.js} +2 -2
  61. streamlit/static/static/js/index.kE3pAFsk.js +1 -0
  62. streamlit/static/static/js/{index.BEVVZtmO.js → index.maQR6iGO.js} +5 -5
  63. streamlit/static/static/js/{input.CYwqmJUN.js → input.Da6flC-J.js} +2 -2
  64. streamlit/static/static/js/{memory.CwoWYYJe.js → memory.RO-tu8XB.js} +1 -1
  65. streamlit/static/static/js/{mergeWith.CM4ZdUxz.js → mergeWith.oFY5pwbY.js} +1 -1
  66. streamlit/static/static/js/{number-overlay-editor.App3Ir5h.js → number-overlay-editor.CmedPuXw.js} +1 -1
  67. streamlit/static/static/js/{possibleConstructorReturn.DLN_CW-A.js → possibleConstructorReturn.DqMD2GCK.js} +1 -1
  68. streamlit/static/static/js/{sandbox.AnJN0uBk.js → sandbox.BoYwQGpJ.js} +1 -1
  69. streamlit/static/static/js/{textarea.uAcwGUtc.js → textarea.BDbR_YS9.js} +2 -2
  70. streamlit/static/static/js/{timepicker.DDp122zI.js → timepicker.oE_U0Vq4.js} +1 -1
  71. streamlit/static/static/js/{toConsumableArray.CXCskjcZ.js → toConsumableArray.Coo3T7lR.js} +1 -1
  72. streamlit/static/static/js/{uniqueId.DQ5uc9Dn.js → uniqueId.DdxHnhj2.js} +1 -1
  73. streamlit/static/static/js/{useBasicWidgetState.DFIfVHMH.js → useBasicWidgetState.BiqDcmFi.js} +1 -1
  74. streamlit/static/static/js/useOnInputChange.DU3LGlRV.js +1 -0
  75. streamlit/static/static/js/{withFullScreenWrapper.6Cdl0P_3.js → withFullScreenWrapper.CvnKWoJw.js} +1 -1
  76. {streamlit_nightly-1.46.2.dev20250626.dist-info → streamlit_nightly-1.46.2.dev20250628.dist-info}/METADATA +1 -1
  77. {streamlit_nightly-1.46.2.dev20250626.dist-info → streamlit_nightly-1.46.2.dev20250628.dist-info}/RECORD +81 -81
  78. streamlit/static/static/js/RenderInPortalIfExists.DLkeeRK1.js +0 -1
  79. streamlit/static/static/js/index.086fJkRW.js +0 -1
  80. streamlit/static/static/js/index.39cFhVAB.js +0 -1
  81. streamlit/static/static/js/index.BBk99Mab.js +0 -1
  82. streamlit/static/static/js/index.BJg-lqwR.js +0 -1
  83. streamlit/static/static/js/index.CJNu66g-.js +0 -1
  84. streamlit/static/static/js/index.Cp5DQ0Nk.js +0 -1
  85. streamlit/static/static/js/index.DbeUpiV0.js +0 -1
  86. streamlit/static/static/js/index.DlQzdr4z.js +0 -1
  87. streamlit/static/static/js/index.Dpi_eA9w.js +0 -1
  88. streamlit/static/static/js/index.Dt6vo5Wt.js +0 -7
  89. streamlit/static/static/js/useOnInputChange.qZzWT6UC.js +0 -1
  90. {streamlit_nightly-1.46.2.dev20250626.data → streamlit_nightly-1.46.2.dev20250628.data}/scripts/streamlit.cmd +0 -0
  91. {streamlit_nightly-1.46.2.dev20250626.dist-info → streamlit_nightly-1.46.2.dev20250628.dist-info}/WHEEL +0 -0
  92. {streamlit_nightly-1.46.2.dev20250626.dist-info → streamlit_nightly-1.46.2.dev20250628.dist-info}/entry_points.txt +0 -0
  93. {streamlit_nightly-1.46.2.dev20250626.dist-info → streamlit_nightly-1.46.2.dev20250628.dist-info}/top_level.txt +0 -0
streamlit/__init__.py CHANGED
@@ -13,7 +13,7 @@
13
13
  # limitations under the License.
14
14
 
15
15
  # isort: skip_file
16
- # ruff: noqa: E402, PLC0414, A001
16
+ # ruff: noqa: E402, A001
17
17
 
18
18
  """Streamlit.
19
19
 
streamlit/config.py CHANGED
@@ -1402,6 +1402,43 @@ _create_theme_options(
1402
1402
  type_=int,
1403
1403
  )
1404
1404
 
1405
+ _create_theme_options(
1406
+ "chartCategoricalColors",
1407
+ categories=["theme"],
1408
+ description="""
1409
+ An array of colors to use for categorical charts.
1410
+
1411
+ If no chart categorical colors are set, Streamlit uses a default set of
1412
+ colors.
1413
+ For light themes the default colors are:
1414
+ [
1415
+ "#0068c9", # blue80
1416
+ "#83c9ff", # blue40
1417
+ "#ff2b2b", # red80
1418
+ "#ffabab", # red40
1419
+ "#29b09d", # blueGreen80
1420
+ "#7defa1", # green40
1421
+ "#ff8700", # orange80
1422
+ "#ffd16a", # orange50
1423
+ "#6d3fc0", # purple80
1424
+ "#d5dae5", # gray40
1425
+ ]
1426
+ For dark themes the default colors are:
1427
+ [
1428
+ "#83c9ff", # blue40
1429
+ "#0068c9", # blue80
1430
+ "#ffabab", # red40
1431
+ "#ff2b2b", # red80
1432
+ "#7defa1", # green40
1433
+ "#29b09d", # blueGreen80
1434
+ "#ffd16a", # orange50
1435
+ "#ff8700", # orange80
1436
+ "#6d3fc0", # purple80
1437
+ "#d5dae5", # gray40
1438
+ ]
1439
+ """,
1440
+ )
1441
+
1405
1442
  # Config Section: Secrets #
1406
1443
 
1407
1444
  _create_section("secrets", "Secrets configuration.")
@@ -16,7 +16,7 @@ from streamlit.proto import AppPage_pb2 as streamlit_dot_proto_dot_AppPage__pb2
16
16
  from streamlit.proto import SessionStatus_pb2 as streamlit_dot_proto_dot_SessionStatus__pb2
17
17
 
18
18
 
19
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/NewSession.proto\x1a\x1dstreamlit/proto/AppPage.proto\x1a#streamlit/proto/SessionStatus.proto\"\xa5\x02\n\nNewSession\x12\x1f\n\ninitialize\x18\x01 \x01(\x0b\x32\x0b.Initialize\x12\x15\n\rscript_run_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x18\n\x10main_script_path\x18\x04 \x01(\t\x12\x17\n\x06\x63onfig\x18\x06 \x01(\x0b\x32\x07.Config\x12(\n\x0c\x63ustom_theme\x18\x07 \x01(\x0b\x32\x12.CustomThemeConfig\x12\x1b\n\tapp_pages\x18\x08 \x03(\x0b\x32\x08.AppPage\x12\x18\n\x10page_script_hash\x18\t \x01(\t\x12\x1d\n\x15\x66ragment_ids_this_run\x18\n \x03(\t\x12\x18\n\x10main_script_hash\x18\x0b \x01(\tJ\x04\x08\x05\x10\x06\"\xba\x01\n\nInitialize\x12\x1c\n\tuser_info\x18\x01 \x01(\x0b\x32\t.UserInfo\x12*\n\x10\x65nvironment_info\x18\x03 \x01(\x0b\x32\x10.EnvironmentInfo\x12&\n\x0esession_status\x18\x04 \x01(\x0b\x32\x0e.SessionStatus\x12\x14\n\x0c\x63ommand_line\x18\x05 \x01(\t\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12\x10\n\x08is_hello\x18\x07 \x01(\x08\"\x97\x02\n\x06\x43onfig\x12\x1a\n\x12gather_usage_stats\x18\x02 \x01(\x08\x12\x1e\n\x16max_cached_message_age\x18\x03 \x01(\x05\x12\x14\n\x0cmapbox_token\x18\x04 \x01(\t\x12\x19\n\x11\x61llow_run_on_save\x18\x05 \x01(\x08\x12\x14\n\x0chide_top_bar\x18\x06 \x01(\x08\x12\x18\n\x10hide_sidebar_nav\x18\x07 \x01(\x08\x12)\n\x0ctoolbar_mode\x18\x08 \x01(\x0e\x32\x13.Config.ToolbarMode\"?\n\x0bToolbarMode\x12\x08\n\x04\x41UTO\x10\x00\x12\r\n\tDEVELOPER\x10\x01\x12\n\n\x06VIEWER\x10\x02\x12\x0b\n\x07MINIMAL\x10\x03J\x04\x08\x01\x10\x02\"\xc2\n\n\x11\x43ustomThemeConfig\x12\x15\n\rprimary_color\x18\x01 \x01(\t\x12\"\n\x1asecondary_background_color\x18\x02 \x01(\t\x12\x18\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\t\x12\x12\n\ntext_color\x18\x04 \x01(\t\x12+\n\x04\x66ont\x18\x05 \x01(\x0e\x32\x1d.CustomThemeConfig.FontFamily\x12*\n\x04\x62\x61se\x18\x06 \x01(\x0e\x32\x1c.CustomThemeConfig.BaseTheme\x12\x1f\n\x17widget_background_color\x18\x07 \x01(\t\x12\x1b\n\x13widget_border_color\x18\x08 \x01(\t\x12\x15\n\x05radii\x18\t \x01(\x0b\x32\x06.Radii\x12\x14\n\x0cheading_font\x18\x0c \x01(\t\x12\x11\n\tbody_font\x18\r \x01(\t\x12\x11\n\tcode_font\x18\x0e \x01(\t\x12\x1d\n\nfont_faces\x18\x0f \x03(\x0b\x32\t.FontFace\x12\x1e\n\nfont_sizes\x18\x10 \x01(\x0b\x32\n.FontSizes\x12!\n\x19skeleton_background_color\x18\x11 \x01(\t\x12\x18\n\x0b\x62\x61se_radius\x18\x12 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rbutton_radius\x18\x1a \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0c\x62order_color\x18\x13 \x01(\tH\x02\x88\x01\x01\x12#\n\x16\x64\x61taframe_border_color\x18\x1b \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12show_widget_border\x18\x14 \x01(\x08H\x04\x88\x01\x01\x12\x17\n\nlink_color\x18\x15 \x01(\tH\x05\x88\x01\x01\x12\x1b\n\x0elink_underline\x18\x1d \x01(\x08H\x06\x88\x01\x01\x12\x1b\n\x0e\x62\x61se_font_size\x18\x16 \x01(\x05H\x07\x88\x01\x01\x12\x1d\n\x10\x62\x61se_font_weight\x18\x1e \x01(\x05H\x08\x88\x01\x01\x12\x1d\n\x10\x63ode_font_weight\x18 \x01(\x05H\t\x88\x01\x01\x12\x1b\n\x0e\x63ode_font_size\x18\x1c \x01(\tH\n\x88\x01\x01\x12 \n\x13show_sidebar_border\x18\x17 \x01(\x08H\x0b\x88\x01\x01\x12(\n\x07sidebar\x18\x18 \x01(\x0b\x32\x12.CustomThemeConfigH\x0c\x88\x01\x01\x12\"\n\x15\x63ode_background_color\x18\x19 \x01(\tH\r\x88\x01\x01\x12.\n!dataframe_header_background_color\x18\x1f \x01(\tH\x0e\x88\x01\x01\" \n\tBaseTheme\x12\t\n\x05LIGHT\x10\x00\x12\x08\n\x04\x44\x41RK\x10\x01\"6\n\nFontFamily\x12\x0e\n\nSANS_SERIF\x10\x00\x12\t\n\x05SERIF\x10\x01\x12\r\n\tMONOSPACE\x10\x02\x42\x0e\n\x0c_base_radiusB\x10\n\x0e_button_radiusB\x0f\n\r_border_colorB\x19\n\x17_dataframe_border_colorB\x15\n\x13_show_widget_borderB\r\n\x0b_link_colorB\x11\n\x0f_link_underlineB\x11\n\x0f_base_font_sizeB\x13\n\x11_base_font_weightB\x13\n\x11_code_font_weightB\x11\n\x0f_code_font_sizeB\x16\n\x14_show_sidebar_borderB\n\n\x08_sidebarB\x18\n\x16_code_background_colorB$\n\"_dataframe_header_background_color\"w\n\x08\x46ontFace\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x0e\n\x06\x66\x61mily\x18\x02 \x01(\t\x12\x12\n\x06weight\x18\x03 \x01(\x05\x42\x02\x18\x01\x12\x14\n\x0cweight_range\x18\x05 \x01(\t\x12\r\n\x05style\x18\x04 \x01(\t\x12\x15\n\runicode_range\x18\x06 \x01(\t\"<\n\x05Radii\x12\x1a\n\x12\x62\x61se_widget_radius\x18\x01 \x01(\x05\x12\x17\n\x0f\x63heckbox_radius\x18\x02 \x01(\x05\"T\n\tFontSizes\x12\x16\n\x0etiny_font_size\x18\x01 \x01(\x05\x12\x17\n\x0fsmall_font_size\x18\x02 \x01(\x05\x12\x16\n\x0e\x62\x61se_font_size\x18\x03 \x01(\x05\"a\n\x08UserInfo\x12\x17\n\x0finstallation_id\x18\x01 \x01(\t\x12\x1a\n\x12installation_id_v3\x18\x05 \x01(\t\x12\x1a\n\x12installation_id_v4\x18\x06 \x01(\tJ\x04\x08\x02\x10\x03\"l\n\x0f\x45nvironmentInfo\x12\x19\n\x11streamlit_version\x18\x01 \x01(\t\x12\x16\n\x0epython_version\x18\x02 \x01(\t\x12\x11\n\tserver_os\x18\x03 \x01(\t\x12\x13\n\x0bhas_display\x18\x04 \x01(\x08\x42/\n\x1c\x63om.snowflake.apps.streamlitB\x0fNewSessionProtob\x06proto3')
19
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n streamlit/proto/NewSession.proto\x1a\x1dstreamlit/proto/AppPage.proto\x1a#streamlit/proto/SessionStatus.proto\"\xa5\x02\n\nNewSession\x12\x1f\n\ninitialize\x18\x01 \x01(\x0b\x32\x0b.Initialize\x12\x15\n\rscript_run_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x18\n\x10main_script_path\x18\x04 \x01(\t\x12\x17\n\x06\x63onfig\x18\x06 \x01(\x0b\x32\x07.Config\x12(\n\x0c\x63ustom_theme\x18\x07 \x01(\x0b\x32\x12.CustomThemeConfig\x12\x1b\n\tapp_pages\x18\x08 \x03(\x0b\x32\x08.AppPage\x12\x18\n\x10page_script_hash\x18\t \x01(\t\x12\x1d\n\x15\x66ragment_ids_this_run\x18\n \x03(\t\x12\x18\n\x10main_script_hash\x18\x0b \x01(\tJ\x04\x08\x05\x10\x06\"\xba\x01\n\nInitialize\x12\x1c\n\tuser_info\x18\x01 \x01(\x0b\x32\t.UserInfo\x12*\n\x10\x65nvironment_info\x18\x03 \x01(\x0b\x32\x10.EnvironmentInfo\x12&\n\x0esession_status\x18\x04 \x01(\x0b\x32\x0e.SessionStatus\x12\x14\n\x0c\x63ommand_line\x18\x05 \x01(\t\x12\x12\n\nsession_id\x18\x06 \x01(\t\x12\x10\n\x08is_hello\x18\x07 \x01(\x08\"\x97\x02\n\x06\x43onfig\x12\x1a\n\x12gather_usage_stats\x18\x02 \x01(\x08\x12\x1e\n\x16max_cached_message_age\x18\x03 \x01(\x05\x12\x14\n\x0cmapbox_token\x18\x04 \x01(\t\x12\x19\n\x11\x61llow_run_on_save\x18\x05 \x01(\x08\x12\x14\n\x0chide_top_bar\x18\x06 \x01(\x08\x12\x18\n\x10hide_sidebar_nav\x18\x07 \x01(\x08\x12)\n\x0ctoolbar_mode\x18\x08 \x01(\x0e\x32\x13.Config.ToolbarMode\"?\n\x0bToolbarMode\x12\x08\n\x04\x41UTO\x10\x00\x12\r\n\tDEVELOPER\x10\x01\x12\n\n\x06VIEWER\x10\x02\x12\x0b\n\x07MINIMAL\x10\x03J\x04\x08\x01\x10\x02\"\xe4\n\n\x11\x43ustomThemeConfig\x12\x15\n\rprimary_color\x18\x01 \x01(\t\x12\"\n\x1asecondary_background_color\x18\x02 \x01(\t\x12\x18\n\x10\x62\x61\x63kground_color\x18\x03 \x01(\t\x12\x12\n\ntext_color\x18\x04 \x01(\t\x12+\n\x04\x66ont\x18\x05 \x01(\x0e\x32\x1d.CustomThemeConfig.FontFamily\x12*\n\x04\x62\x61se\x18\x06 \x01(\x0e\x32\x1c.CustomThemeConfig.BaseTheme\x12\x1f\n\x17widget_background_color\x18\x07 \x01(\t\x12\x1b\n\x13widget_border_color\x18\x08 \x01(\t\x12\x15\n\x05radii\x18\t \x01(\x0b\x32\x06.Radii\x12\x14\n\x0cheading_font\x18\x0c \x01(\t\x12\x11\n\tbody_font\x18\r \x01(\t\x12\x11\n\tcode_font\x18\x0e \x01(\t\x12\x1d\n\nfont_faces\x18\x0f \x03(\x0b\x32\t.FontFace\x12\x1e\n\nfont_sizes\x18\x10 \x01(\x0b\x32\n.FontSizes\x12!\n\x19skeleton_background_color\x18\x11 \x01(\t\x12\x18\n\x0b\x62\x61se_radius\x18\x12 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rbutton_radius\x18\x1a \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0c\x62order_color\x18\x13 \x01(\tH\x02\x88\x01\x01\x12#\n\x16\x64\x61taframe_border_color\x18\x1b \x01(\tH\x03\x88\x01\x01\x12\x1f\n\x12show_widget_border\x18\x14 \x01(\x08H\x04\x88\x01\x01\x12\x17\n\nlink_color\x18\x15 \x01(\tH\x05\x88\x01\x01\x12\x1b\n\x0elink_underline\x18\x1d \x01(\x08H\x06\x88\x01\x01\x12\x1b\n\x0e\x62\x61se_font_size\x18\x16 \x01(\x05H\x07\x88\x01\x01\x12\x1d\n\x10\x62\x61se_font_weight\x18\x1e \x01(\x05H\x08\x88\x01\x01\x12\x1d\n\x10\x63ode_font_weight\x18 \x01(\x05H\t\x88\x01\x01\x12\x1b\n\x0e\x63ode_font_size\x18\x1c \x01(\tH\n\x88\x01\x01\x12 \n\x13show_sidebar_border\x18\x17 \x01(\x08H\x0b\x88\x01\x01\x12(\n\x07sidebar\x18\x18 \x01(\x0b\x32\x12.CustomThemeConfigH\x0c\x88\x01\x01\x12\"\n\x15\x63ode_background_color\x18\x19 \x01(\tH\r\x88\x01\x01\x12.\n!dataframe_header_background_color\x18\x1f \x01(\tH\x0e\x88\x01\x01\x12 \n\x18\x63hart_categorical_colors\x18! \x03(\t\" \n\tBaseTheme\x12\t\n\x05LIGHT\x10\x00\x12\x08\n\x04\x44\x41RK\x10\x01\"6\n\nFontFamily\x12\x0e\n\nSANS_SERIF\x10\x00\x12\t\n\x05SERIF\x10\x01\x12\r\n\tMONOSPACE\x10\x02\x42\x0e\n\x0c_base_radiusB\x10\n\x0e_button_radiusB\x0f\n\r_border_colorB\x19\n\x17_dataframe_border_colorB\x15\n\x13_show_widget_borderB\r\n\x0b_link_colorB\x11\n\x0f_link_underlineB\x11\n\x0f_base_font_sizeB\x13\n\x11_base_font_weightB\x13\n\x11_code_font_weightB\x11\n\x0f_code_font_sizeB\x16\n\x14_show_sidebar_borderB\n\n\x08_sidebarB\x18\n\x16_code_background_colorB$\n\"_dataframe_header_background_color\"w\n\x08\x46ontFace\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x0e\n\x06\x66\x61mily\x18\x02 \x01(\t\x12\x12\n\x06weight\x18\x03 \x01(\x05\x42\x02\x18\x01\x12\x14\n\x0cweight_range\x18\x05 \x01(\t\x12\r\n\x05style\x18\x04 \x01(\t\x12\x15\n\runicode_range\x18\x06 \x01(\t\"<\n\x05Radii\x12\x1a\n\x12\x62\x61se_widget_radius\x18\x01 \x01(\x05\x12\x17\n\x0f\x63heckbox_radius\x18\x02 \x01(\x05\"T\n\tFontSizes\x12\x16\n\x0etiny_font_size\x18\x01 \x01(\x05\x12\x17\n\x0fsmall_font_size\x18\x02 \x01(\x05\x12\x16\n\x0e\x62\x61se_font_size\x18\x03 \x01(\x05\"a\n\x08UserInfo\x12\x17\n\x0finstallation_id\x18\x01 \x01(\t\x12\x1a\n\x12installation_id_v3\x18\x05 \x01(\t\x12\x1a\n\x12installation_id_v4\x18\x06 \x01(\tJ\x04\x08\x02\x10\x03\"l\n\x0f\x45nvironmentInfo\x12\x19\n\x11streamlit_version\x18\x01 \x01(\t\x12\x16\n\x0epython_version\x18\x02 \x01(\t\x12\x11\n\tserver_os\x18\x03 \x01(\t\x12\x13\n\x0bhas_display\x18\x04 \x01(\x08\x42/\n\x1c\x63om.snowflake.apps.streamlitB\x0fNewSessionProtob\x06proto3')
20
20
 
21
21
  _globals = globals()
22
22
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -35,19 +35,19 @@ if not _descriptor._USE_C_DESCRIPTORS:
35
35
  _globals['_CONFIG_TOOLBARMODE']._serialized_start=800
36
36
  _globals['_CONFIG_TOOLBARMODE']._serialized_end=863
37
37
  _globals['_CUSTOMTHEMECONFIG']._serialized_start=872
38
- _globals['_CUSTOMTHEMECONFIG']._serialized_end=2218
39
- _globals['_CUSTOMTHEMECONFIG_BASETHEME']._serialized_start=1815
40
- _globals['_CUSTOMTHEMECONFIG_BASETHEME']._serialized_end=1847
41
- _globals['_CUSTOMTHEMECONFIG_FONTFAMILY']._serialized_start=1849
42
- _globals['_CUSTOMTHEMECONFIG_FONTFAMILY']._serialized_end=1903
43
- _globals['_FONTFACE']._serialized_start=2220
44
- _globals['_FONTFACE']._serialized_end=2339
45
- _globals['_RADII']._serialized_start=2341
46
- _globals['_RADII']._serialized_end=2401
47
- _globals['_FONTSIZES']._serialized_start=2403
48
- _globals['_FONTSIZES']._serialized_end=2487
49
- _globals['_USERINFO']._serialized_start=2489
50
- _globals['_USERINFO']._serialized_end=2586
51
- _globals['_ENVIRONMENTINFO']._serialized_start=2588
52
- _globals['_ENVIRONMENTINFO']._serialized_end=2696
38
+ _globals['_CUSTOMTHEMECONFIG']._serialized_end=2252
39
+ _globals['_CUSTOMTHEMECONFIG_BASETHEME']._serialized_start=1849
40
+ _globals['_CUSTOMTHEMECONFIG_BASETHEME']._serialized_end=1881
41
+ _globals['_CUSTOMTHEMECONFIG_FONTFAMILY']._serialized_start=1883
42
+ _globals['_CUSTOMTHEMECONFIG_FONTFAMILY']._serialized_end=1937
43
+ _globals['_FONTFACE']._serialized_start=2254
44
+ _globals['_FONTFACE']._serialized_end=2373
45
+ _globals['_RADII']._serialized_start=2375
46
+ _globals['_RADII']._serialized_end=2435
47
+ _globals['_FONTSIZES']._serialized_start=2437
48
+ _globals['_FONTSIZES']._serialized_end=2521
49
+ _globals['_USERINFO']._serialized_start=2523
50
+ _globals['_USERINFO']._serialized_end=2620
51
+ _globals['_ENVIRONMENTINFO']._serialized_start=2622
52
+ _globals['_ENVIRONMENTINFO']._serialized_end=2730
53
53
  # @@protoc_insertion_point(module_scope)
@@ -299,6 +299,7 @@ class CustomThemeConfig(google.protobuf.message.Message):
299
299
  SIDEBAR_FIELD_NUMBER: builtins.int
300
300
  CODE_BACKGROUND_COLOR_FIELD_NUMBER: builtins.int
301
301
  DATAFRAME_HEADER_BACKGROUND_COLOR_FIELD_NUMBER: builtins.int
302
+ CHART_CATEGORICAL_COLORS_FIELD_NUMBER: builtins.int
302
303
  primary_color: builtins.str
303
304
  secondary_background_color: builtins.str
304
305
  background_color: builtins.str
@@ -341,6 +342,8 @@ class CustomThemeConfig(google.protobuf.message.Message):
341
342
 
342
343
  @property
343
344
  def sidebar(self) -> global___CustomThemeConfig: ...
345
+ @property
346
+ def chart_categorical_colors(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.str]: ...
344
347
  def __init__(
345
348
  self,
346
349
  *,
@@ -374,9 +377,10 @@ class CustomThemeConfig(google.protobuf.message.Message):
374
377
  sidebar: global___CustomThemeConfig | None = ...,
375
378
  code_background_color: builtins.str | None = ...,
376
379
  dataframe_header_background_color: builtins.str | None = ...,
380
+ chart_categorical_colors: collections.abc.Iterable[builtins.str] | None = ...,
377
381
  ) -> None: ...
378
382
  def HasField(self, field_name: typing.Literal["_base_font_size", b"_base_font_size", "_base_font_weight", b"_base_font_weight", "_base_radius", b"_base_radius", "_border_color", b"_border_color", "_button_radius", b"_button_radius", "_code_background_color", b"_code_background_color", "_code_font_size", b"_code_font_size", "_code_font_weight", b"_code_font_weight", "_dataframe_border_color", b"_dataframe_border_color", "_dataframe_header_background_color", b"_dataframe_header_background_color", "_link_color", b"_link_color", "_link_underline", b"_link_underline", "_show_sidebar_border", b"_show_sidebar_border", "_show_widget_border", b"_show_widget_border", "_sidebar", b"_sidebar", "base_font_size", b"base_font_size", "base_font_weight", b"base_font_weight", "base_radius", b"base_radius", "border_color", b"border_color", "button_radius", b"button_radius", "code_background_color", b"code_background_color", "code_font_size", b"code_font_size", "code_font_weight", b"code_font_weight", "dataframe_border_color", b"dataframe_border_color", "dataframe_header_background_color", b"dataframe_header_background_color", "font_sizes", b"font_sizes", "link_color", b"link_color", "link_underline", b"link_underline", "radii", b"radii", "show_sidebar_border", b"show_sidebar_border", "show_widget_border", b"show_widget_border", "sidebar", b"sidebar"]) -> builtins.bool: ...
379
- def ClearField(self, field_name: typing.Literal["_base_font_size", b"_base_font_size", "_base_font_weight", b"_base_font_weight", "_base_radius", b"_base_radius", "_border_color", b"_border_color", "_button_radius", b"_button_radius", "_code_background_color", b"_code_background_color", "_code_font_size", b"_code_font_size", "_code_font_weight", b"_code_font_weight", "_dataframe_border_color", b"_dataframe_border_color", "_dataframe_header_background_color", b"_dataframe_header_background_color", "_link_color", b"_link_color", "_link_underline", b"_link_underline", "_show_sidebar_border", b"_show_sidebar_border", "_show_widget_border", b"_show_widget_border", "_sidebar", b"_sidebar", "background_color", b"background_color", "base", b"base", "base_font_size", b"base_font_size", "base_font_weight", b"base_font_weight", "base_radius", b"base_radius", "body_font", b"body_font", "border_color", b"border_color", "button_radius", b"button_radius", "code_background_color", b"code_background_color", "code_font", b"code_font", "code_font_size", b"code_font_size", "code_font_weight", b"code_font_weight", "dataframe_border_color", b"dataframe_border_color", "dataframe_header_background_color", b"dataframe_header_background_color", "font", b"font", "font_faces", b"font_faces", "font_sizes", b"font_sizes", "heading_font", b"heading_font", "link_color", b"link_color", "link_underline", b"link_underline", "primary_color", b"primary_color", "radii", b"radii", "secondary_background_color", b"secondary_background_color", "show_sidebar_border", b"show_sidebar_border", "show_widget_border", b"show_widget_border", "sidebar", b"sidebar", "skeleton_background_color", b"skeleton_background_color", "text_color", b"text_color", "widget_background_color", b"widget_background_color", "widget_border_color", b"widget_border_color"]) -> None: ...
383
+ def ClearField(self, field_name: typing.Literal["_base_font_size", b"_base_font_size", "_base_font_weight", b"_base_font_weight", "_base_radius", b"_base_radius", "_border_color", b"_border_color", "_button_radius", b"_button_radius", "_code_background_color", b"_code_background_color", "_code_font_size", b"_code_font_size", "_code_font_weight", b"_code_font_weight", "_dataframe_border_color", b"_dataframe_border_color", "_dataframe_header_background_color", b"_dataframe_header_background_color", "_link_color", b"_link_color", "_link_underline", b"_link_underline", "_show_sidebar_border", b"_show_sidebar_border", "_show_widget_border", b"_show_widget_border", "_sidebar", b"_sidebar", "background_color", b"background_color", "base", b"base", "base_font_size", b"base_font_size", "base_font_weight", b"base_font_weight", "base_radius", b"base_radius", "body_font", b"body_font", "border_color", b"border_color", "button_radius", b"button_radius", "chart_categorical_colors", b"chart_categorical_colors", "code_background_color", b"code_background_color", "code_font", b"code_font", "code_font_size", b"code_font_size", "code_font_weight", b"code_font_weight", "dataframe_border_color", b"dataframe_border_color", "dataframe_header_background_color", b"dataframe_header_background_color", "font", b"font", "font_faces", b"font_faces", "font_sizes", b"font_sizes", "heading_font", b"heading_font", "link_color", b"link_color", "link_underline", b"link_underline", "primary_color", b"primary_color", "radii", b"radii", "secondary_background_color", b"secondary_background_color", "show_sidebar_border", b"show_sidebar_border", "show_widget_border", b"show_widget_border", "sidebar", b"sidebar", "skeleton_background_color", b"skeleton_background_color", "text_color", b"text_color", "widget_background_color", b"widget_background_color", "widget_border_color", b"widget_border_color"]) -> None: ...
380
384
  @typing.overload
381
385
  def WhichOneof(self, oneof_group: typing.Literal["_base_font_size", b"_base_font_size"]) -> typing.Literal["base_font_size"] | None: ...
382
386
  @typing.overload
@@ -940,7 +940,10 @@ def _populate_theme_msg(msg: CustomThemeConfig, section: str = "theme") -> None:
940
940
  for option_name, option_val in theme_opts.items():
941
941
  # We need to ignore some config options here that need special handling
942
942
  # and cannot directly be set on the protobuf.
943
- if option_name not in {"base", "font", "fontFaces"} and option_val is not None:
943
+ if (
944
+ option_name not in {"base", "font", "fontFaces", "chartCategoricalColors"}
945
+ and option_val is not None
946
+ ):
944
947
  setattr(msg, to_snake_case(option_name), option_val)
945
948
 
946
949
  # NOTE: If unset, base and font will default to the protobuf enum zero
@@ -998,6 +1001,32 @@ def _populate_theme_msg(msg: CustomThemeConfig, section: str = "theme") -> None:
998
1001
  exc_info=e,
999
1002
  )
1000
1003
 
1004
+ chart_categorical_colors = theme_opts.get("chartCategoricalColors", None)
1005
+ # If chartCategoricalColors was configured via config.toml, it's already a list of
1006
+ # strings. However, if it was provided via env variable or via CLI arg,
1007
+ # it's a json string that needs to be parsed.
1008
+ if isinstance(chart_categorical_colors, str):
1009
+ try:
1010
+ chart_categorical_colors = json.loads(chart_categorical_colors)
1011
+ except json.JSONDecodeError as e:
1012
+ _LOGGER.warning(
1013
+ "Failed to parse the theme.chartCategoricalColors config option: %s.",
1014
+ chart_categorical_colors,
1015
+ exc_info=e,
1016
+ )
1017
+ chart_categorical_colors = None
1018
+
1019
+ if chart_categorical_colors is not None:
1020
+ for color in chart_categorical_colors:
1021
+ try:
1022
+ msg.chart_categorical_colors.append(color)
1023
+ except Exception as e: # noqa: PERF203
1024
+ _LOGGER.warning(
1025
+ "Failed to parse the theme.chartCategoricalColors config option: %s.",
1026
+ color,
1027
+ exc_info=e,
1028
+ )
1029
+
1001
1030
 
1002
1031
  def _populate_user_info_msg(msg: UserInfo) -> None:
1003
1032
  inst = Installation.instance()
@@ -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
- F = TypeVar("F", bound=Callable[..., Any])
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: F) -> F: ...
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[[F], F]: ...
378
+ ) -> Callable[[Callable[P, T_co]], CachedFunc[P, T_co]]: ...
360
379
 
361
380
  def __call__(
362
381
  self,
363
- func: F | None = None,
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
- ) -> F | Callable[[F], F]:
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: F | None = None,
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
- ) -> F | Callable[[F], F]:
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: F) -> F:
589
+ def wrapper(f: Callable[P, T_co]) -> CachedFunc[P, T_co]:
571
590
  return cast(
572
- "F",
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 TYPE_CHECKING, Any, Callable, Final, TypeVar, cast, overload
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: F) -> F: ...
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[[F], F]: ...
252
+ ) -> Callable[[Callable[P, T_co]], CachedFunc[P, T_co]]: ...
226
253
 
227
254
  def __call__(
228
255
  self,
229
- func: F | None = None,
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
- ) -> F | Callable[[F], F]:
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: F | None,
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
- ) -> F | Callable[[F], F]:
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
@@ -37,7 +37,7 @@
37
37
  <script>
38
38
  window.prerenderReady = false
39
39
  </script>
40
- <script type="module" crossorigin src="./static/js/index.Du_GhChx.js"></script>
40
+ <script type="module" crossorigin src="./static/js/index.CSMFgqFx.js"></script>
41
41
  <link rel="stylesheet" crossorigin href="./static/css/index.CJVRHjQZ.css">
42
42
  </head>
43
43
  <body>