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
{{ message }}
Repository navigation
Inconsistent Tokenization due to Lazy Registration #8111
The bug requires a subclass of a pandas (or other lazily registered module) to be tokenized before and then after an object in the module.
It occurs because the Dispatcher used by tokenize decides whether to lazily register modules by checking the toplevel module of the class. Therefore, it will not attempt to lazily register a module of a subclass of an object from the module. However, if the module is already registered, those handlers will be used before the generic object handler when applicable (due to MRO).
The same issue exists for all lazily loaded modules.
I think a better behavior would be for the lazy registration check to walk the MRO of the object and make sure that any lazy-loaded modules are triggered
Thanks for writing this up @v1shanker! I looked at it at the time but forgot to write down what I found 🤦 Looking at it again now I can't quite figure out what the behavior should be. Regardless of whether I've tokenized a pandas object or not, I get a different hash every time I call dask.base.tokenize(custom_df). Is that what you see?
Activity
jsignell commentedon Sep 16, 2021
Thanks for writing this up @v1shanker! I looked at it at the time but forgot to write down what I found 🤦 Looking at it again now I can't quite figure out what the behavior should be. Regardless of whether I've tokenized a pandas object or not, I get a different hash every time I call
dask.base.tokenize(custom_df). Is that what you see?vikshanker commentedon Sep 16, 2021
Yes I do see this behavior now (although I can't remember if I tested this particular case when I wrote this up).
So it seems there are two different issues here:
point 1 likely hides observation of point 2 in most (if not all) cases.
Thanks for taking a look! Happy to help however I can.
Dispatch walks mro for lazily registered handlers
jcrist commentedon Sep 27, 2021
Thanks @v1shanker, I've pushed a patch for this hereat #8185.
Dispatch walks mro for lazily registered handlers (#8185)