dask / dask/cachey

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

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
142
Forks
21
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Research direction

Start by running the minimal example from the issue, then inspect Cache.memoize and the cache-key handling it uses for positional and keyword arguments. Done means equivalent calls such as boo(df=df) and boo(df) consistently share the cached result, with the behavior covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
pandas, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.