Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Support hashing for Enum classes #5426

Merged
merged 1 commit into from
Sep 27, 2022

Conversation

lluissalord
Copy link
Contributor

📚 Context

In our project, we heavily rely on Enum classes in order to enumerate and classify types of things. However, currently they are not supported by Streamlit for caching with st.experimental_memo because they are not correctly hashed.

  • What kind of change does this PR introduce?

    • Bugfix
    • Feature
    • Refactoring
    • Other, please describe:

🧠 Description of Changes

  • Support for Enum class hashing for st.experimental_memo

    • This is a breaking API change
    • This is a visible (user-facing) change

🧪 Testing Done

  • Screenshots included
  • Added/Updated unit tests
  • Added/Updated e2e tests

🌐 References


Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@lluissalord lluissalord requested a review from a team September 27, 2022 08:18
@kajarenc
Copy link
Collaborator

Thank you @lluissalord for this PR!
I agree that we should support python Enums as parameters for memoized functions!

LGTM 👍

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.

experimental_memo fails to hash input arguments that are class instances
2 participants