Skip to content

Conversation

@tconkling
Copy link
Contributor

@tconkling tconkling commented Nov 17, 2022

CacheType.value is currently implicitly used to store the name of the public API that the CacheType refers to. (That is, CacheType.MEMO has the value "experimental_memo".) This isn't documented anywhere, and it's not intuitive.

This PR changes that:

  • CacheType.value is now the stringified version of the enum name ("MEMO" and "SINGLETON" instead of "experimental_memo" and "experimental_singleton")
  • A new function, get_decorator_api_name, returns the public API name for the given CacheType

- Move CacheType out of cache_errors.py, since it's not intrinsically error-related
- CacheType.value is no longer the public API name of the decorator it refers to. Instead, `get_decorator_api_name` implements this mapping explicitly.
@tconkling tconkling merged commit d41315d into streamlit:develop Nov 18, 2022
@tconkling tconkling deleted the tim/CacheTypeEnumSanity branch November 18, 2022 23:57
tconkling added a commit to tconkling/streamlit that referenced this pull request Nov 18, 2022
* develop:
  cache_utils.get_decorator_api_name util (streamlit#5721)
  Add blocking tests to release workflow (streamlit#5732)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants