-
Notifications
You must be signed in to change notification settings - Fork 2
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
do not resolve path we pass into decorated function? #44
Comments
@jwodder could you please have a look either there is an easy/safe resolution for it? |
@yarikoptic I believe the motivation was something like ensuring that identical relative paths run from different working directories wouldn't be confused, though now that file fingerprints include the inode number, that may be less of an issue. I'm not clear on why this is a problem. Does git-annex use different symlink paths for identical files? |
IIRC it was more of a fact that underlying function needed that original path, so it could lookup annex key from a symlink here https://github.com/dandi/dandisets/blob/master/tools/backups2datalad.py#L263 . I guess logic could just operate straight on the file under I think decorator indeed must operate on the resolved paths (to cache all the inodes etc) but pass original path into the decorated function. |
@yarikoptic I've tried to update the code to pass the original path to the decorated function in #45, but the tests are failing for some inscrutable reason. I feel inclined to blame the |
@yarikoptic I've gone back to this, as this or something similar is needed for #58. The reason the tests are failing is because the unresolved path is still being seen by joblib and used in accessing the cache, which means that when the tests reach this point where the previously-cached file is accessed through a symlink, passing the unresolved symlink path to the decorated function results in an uncached call and a cache miss, which is a change in behavior. One way to resolve this would be to tell joblib to ignore the "path" argument itself, but if we applied that to #58, then non-path attributes of instances would be ignored, which seems undesirable. A related solution would be to give |
@yarikoptic So what should #58 do about resolving path attributes when decorating methods? |
prompted by investigating dandi/dandisets#38 -- it seems we resolve path which we pass to underlying function:
code -- we pass os.realpath resolved path into original function
we should check on original motivation and either it could/should be avoided!
The text was updated successfully, but these errors were encountered: