Skip to content

Improve st.cache error handling for Unhashable Types #1251

@jrhone

Description

@jrhone

We need to improve the error handling in the code snippet below.

            try:
                reduce_data = obj.__reduce__()
            except BaseException as e:
                raise UnhashableTypeError(e, obj)

Objects can define their own __getstate__ method which get called by __reduce__. Therefore a bug could occur in this __getstate__ call, the error for which should bubble up to the user.

Currently we're suppressing this error message and type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:cacheRelated to `st.cache_data` and `st.cache_resource`type:bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions