-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Built-in hash() method is not deterministic, which breaks cachier since #17 #18
Comments
@louismartin encountered the same issue yesterday, took me like 5 hours to get that v 1.3.0 broke my code 😄 1.2.8 works fine Hope it will be fixed Here is a github action that reproduces the issue Here is the github action run logs |
It took me a few hours to narrow it down to the hash function as well :) |
On it. I've added a test that reproduces this on my machine. I now want to make I reproduce this on every Travis test configuration, and then I can move forward with test cross-kernel stable hash functions. |
Done. Now let's see if |
Should be solved by release v1.3.3. |
Thanks for fixing this so quickly! |
Sure thing! Any pickle-able object should now be a valid argument to a cache-wrapper function - with special treatment given to pandas DataFrames and numpy arrays - so feel free to try things out. |
Cachier is broken for me since #17 for string arguments (probably for other built-in objects as well).
This comes from the fact that the built-in
hash()
method is not deterministic between runs in python.Therefore calling it on the arguments of the function for caching purpose does not work between multiple runs because it will hash to different values.
The problematic call to
hash()
is here.Repro
Run this script twice in a row and it will re-execute the method
test()
each time without relying on the cache:The text was updated successfully, but these errors were encountered: