syrusakbary / aiodataloader

Asyncio DataLoader for Python3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow overriding get_cache_key method on subclass

dkbarn opened this issue · comments

I prefer to subclass DataLoader and provide an overridden batch_load_fn on the subclass, rather than passing a function into DataLoader's constructor (which feels a little too Javascript-y).

Please could the same functionality be provided for the get_cache_key function? At the moment, there is no way to override this function on a subclass because of the way the function is defaulted inside the constructor.

@dkbarn, let me know if you see any issues with this solution.