You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since being one of the few choices available in Python's Dash library, and since there is heavy usage of pandas.DataFrames in general, could the .memoize() functions introduce support for these?
As of now I believe the functions simply tries to hash the DataFrame object and not its contents. Which doesn't guarantee the same hash for the same frame (data-wise).
pandas has the following function: pandas.util.hash_pandas_object which could be used to hash the contents.
The user could then specify which input parameters/arguments of decorated functions are DataFrames via an additional frames parameter.
It could work similarly to the ignore parameter. i.e. something like the following.
@cache.memoize(frames={0, 'myDF'})
def someFunc(myDF, someDate, someString):
# do some operation(s)
return someResult
The text was updated successfully, but these errors were encountered:
given how commonly Pandas DFs are used, seems it would make sense to special-case this inside diskcache and not make the user manually specify the dataframe inputs
Alternatively/additionally is there a way that custom hashers/serializers could be used? (haven't seen any obvious support for this today in the docs, but maybe I missed something, or maybe it's something that could be added?)
Since being one of the few choices available in Python's Dash library, and since there is heavy usage of pandas.DataFrames in general, could the .memoize() functions introduce support for these?
As of now I believe the functions simply tries to hash the DataFrame object and not its contents. Which doesn't guarantee the same hash for the same frame (data-wise).
pandas has the following function: pandas.util.hash_pandas_object which could be used to hash the contents.
The user could then specify which input parameters/arguments of decorated functions are DataFrames via an additional frames parameter.
It could work similarly to the ignore parameter. i.e. something like the following.
The text was updated successfully, but these errors were encountered: