Skip to content

fix(workflow): correct filelock path for file:// URIs#2169

Open
warren618 wants to merge 1 commit intomicrosoft:mainfrom
warren618:fix/mlflow-filelock-path
Open

fix(workflow): correct filelock path for file:// URIs#2169
warren618 wants to merge 1 commit intomicrosoft:mainfrom
warren618:fix/mlflow-filelock-path

Conversation

@warren618
Copy link
Copy Markdown

Summary

Fixes #2129

For file:///home/user/project/mlruns, urlparse gives netloc="" and path="/home/user/project/mlruns". The previous code used pr.path.lstrip("/") which stripped the leading /, making the path relative. os.path.join("", "home/user/...", "filelock") then resolved it relative to cwd, producing a doubled path:

/home/user/project/home/user/project/mlruns/filelock

Fix

- Path(os.path.join(pr.netloc, pr.path.lstrip("/"), "filelock"))
+ Path(pr.netloc + pr.path) / "filelock"

Preserves the absolute path from the URI directly.

For file:///home/user/.../mlruns, urlparse gives netloc="" and
path="/home/user/.../mlruns". The previous code used lstrip("/") which
stripped the leading slash, making the path relative. os.path.join then
resolved it relative to cwd, producing a doubled path like:
/home/user/project/home/user/project/mlruns/filelock

Use pr.netloc + pr.path directly to preserve the absolute path.

Fixes microsoft#2129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unexpected mlruns/filelock path

1 participant