New Caching decorators not working with Classes with __init__

Just upgraded to 1.19 and it still does not work:

UnhashableParamError: Cannot hash argument ‘self’ (of type gooddata.execute.GoodDataExecutor) in ‘execute_stored_insight’.

To address this, you can tell Streamlit not to hash this argument by adding a leading underscore to the argument’s name in the function signature:

@st.cache_data
def execute_stored_insight(_self, ...):
    ...
1 Like