Skip to content

Conversation

@tconkling
Copy link
Contributor

Adds ttl and max_entries support to @st.experimental_singleton.

This is primarily just copied from the existing support in memo, which means that singleton now uses a cachetools.TTLCache instance for its storage.

There are a few new common utilities and tests where appropriate.

@tconkling tconkling requested a review from kajarenc December 6, 2022 20:48
@tconkling tconkling added the security-assessment-completed Security assessment has been completed for PR label Dec 6, 2022
from typing import Any
from unittest.mock import MagicMock, Mock, mock_open, patch

from parameterized import parameterized
Copy link
Collaborator

@kajarenc kajarenc Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: looks like this import is unused now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh whoops - I totally missed that and hit merge. I'll get it in an upcoming PR!

@tconkling tconkling merged commit dadc2c8 into streamlit:develop Dec 7, 2022
@tconkling tconkling deleted the tim/SingletonTTL branch December 7, 2022 17:52
tconkling added a commit that referenced this pull request Dec 7, 2022
* develop:
  Singleton: `ttl` and `max_entries` support (#5821)
  Bump express from 4.17.1 to 4.18.2 in /frontend (#5823)
  Bump qs from 6.5.2 to 6.5.3 in /frontend (#5822)
  Bump decode-uri-component from 0.2.0 to 0.2.2 in /frontend (#5802)
  Improve st.experimental_memo exception on Snowpark/PySpark integration (#5791)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants