cachey icon indicating copy to clipboard operation
cachey copied to clipboard

unexpected behavior in cached function when key words arguments are used.

Open asdf8601 opened this issue 6 years ago • 0 comments

Hello,

I have found this project very useful and while I was doing tests I have found this behavior unexpected for me.

I leave below a minimum reproducible example:

import pandas as pd
import cachey

df = pd.DataFrame([[1, 2]], columns=list("ab"))
c = cachey.Cache(1e9)


@c.memoize
def boo(df):
    print("not cached!")
    return df, df.to_dict()


boo(df=df)  # not works
boo(df)    # works
boo(df)    # works 

I don't know if this comment is appropriate but I thought it was interesting, maybe you can give me a clue as to what could cause this problem.

asdf8601 avatar Feb 21 '19 21:02 asdf8601