Skip to content

[Python] Fix relative paths on Windows PCs with multiple drives#3718

Merged
kanterov merged 3 commits into
mainfrom
handle-windows-commonpath
Oct 8, 2025
Merged

[Python] Fix relative paths on Windows PCs with multiple drives#3718
kanterov merged 3 commits into
mainfrom
handle-windows-commonpath

Conversation

@kanterov

@kanterov kanterov commented Oct 3, 2025

Copy link
Copy Markdown
Collaborator

Changes

Fix a problem in _relativize_path where it crashes on Windows if the supplied path is on a different drive from CWD.

Since paths on different drives don't have anything common, we simply return the supplied path as-is.

Why

Fixes #3658

Tests

Unit tests

@kanterov kanterov temporarily deployed to test-trigger-is October 3, 2025 14:04 — with GitHub Actions Inactive
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 3, 2025

Copy link
Copy Markdown
Collaborator

Run: 18341877827

Env ✅​pass 🙈​skip 🪲​BUG
🪲​ aws linux 321 541 1
🪲​ aws windows 322 540 1
🪲​ aws-ucws linux 437 437 1
🪲​ aws-ucws windows 438 436 1
🪲​ azure linux 321 540 1
🪲​ azure windows 322 539 1
🪲​ azure-ucws linux 437 436 1
🪲​ azure-ucws windows 438 435 1
🪲​ gcp linux 320 542 1
🪲​ gcp windows 321 541 1
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
TestTelemetryEndpoint 🪲​BUG 🪲​BUG 🪲​BUG 🪲​BUG 🪲​BUG 🪲​BUG 🪲​BUG 🪲​BUG 🪲​BUG 🪲​BUG

@kanterov kanterov marked this pull request as ready for review October 3, 2025 15:09

@pietern pietern left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function appears to be used only for making locations in diagnostics relative. If it were also used to make notebook/file paths relative (e.g. spark_python_task), then not returning a relative path presents a failure mode.

Please add a comment describing how this function is supposed to be called and that it can return an absolute path. It should never be used in cases where we really need a relative path.

@kanterov kanterov temporarily deployed to test-trigger-is October 6, 2025 07:36 — with GitHub Actions Inactive
@kanterov kanterov enabled auto-merge October 6, 2025 07:37
@kanterov kanterov temporarily deployed to test-trigger-is October 8, 2025 10:34 — with GitHub Actions Inactive
@kanterov kanterov added this pull request to the merge queue Oct 8, 2025
Merged via the queue into main with commit 449a250 Oct 8, 2025
20 checks passed
@kanterov kanterov deleted the handle-windows-commonpath branch October 8, 2025 11:22
denik pushed a commit that referenced this pull request May 20, 2026
## Changes
Fix a problem in `_relativize_path` where it crashes on Windows if the
supplied path is on a different drive from CWD.

Since paths on different drives don't have anything common, we simply
return the supplied path as-is.

## Why
Fixes #3658

## Tests
Unit tests
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.

PyDABs failing in GitHub action with ValueError: Paths don't have the same drive

3 participants