CI: Add Windows unit test job - #3723
Open
qzyu999 wants to merge 2 commits into
Open
Conversation
On Windows, Python's urlparse treats paths like 'C:\Users\...' as having scheme='c', causing 'Unrecognized filesystem type in URI: c' errors. Uses os.path.splitdrive to detect Windows drive-letter paths before urlparse is called, avoiding the misparse entirely. splitdrive is inherently platform-aware (no-op on Linux/macOS) so no sys.platform check is needed. Fixes all three parse sites (_infer_file_io_from_scheme, PyArrowFileIO.parse_location, FsspecFileIO._get_fs_from_uri) and includes platform-conditional tests. Related: apache#2477, apache#1005
Fokko
reviewed
Aug 2, 2026
Fokko
left a comment
Contributor
There was a problem hiding this comment.
Just some small comments, mostly the one around updating the schema-mismatch tests. But apart from that I think this is something that would be great to add.
qzyu999
force-pushed
the
add-windows-ci-job
branch
from
August 2, 2026 19:11
e4f7648 to
7fa2b4a
Compare
Fokko
reviewed
Aug 2, 2026
| with pytest.raises(OSError) as exc_info: | ||
| r.seek(0, 0) | ||
| assert "only valid on seekable files" in str(exc_info.value) | ||
| try: |
Contributor
There was a problem hiding this comment.
Suggested change
| try: | |
| with input_file.open(seekable=True) as r: |
Fokko
approved these changes
Aug 2, 2026
Adds a windows-latest job to python-ci.yml and fixes platform assumptions in tests that prevented the suite from passing on Windows. Test fixes: - Reduce RANDOM_LENGTH to 8 (Windows MAX_PATH is 260 chars) - Use warehouse.as_posix() in SQLite URIs - Use context managers for file handles (Windows file locking) - Use os.path.abspath() in path assertions - Use raw paths instead of file: URIs in pyarrow fixtures - Skip Rich box-rendering tests on Windows (different terminal chars) - Skip Kerberos tests on Windows (puresasl C lib unavailable) - Relax error message assertion ([WinError 2] vs [Errno 2]) - Normalize backslashes in Hive path assertions Result: 3795+ tests pass on Windows with 0 failures. Depends on apache#3721. Closes apache#2477.
qzyu999
force-pushed
the
add-windows-ci-job
branch
from
August 2, 2026 19:57
7fa2b4a to
c55b2ac
Compare
This was referenced Aug 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
Adds
windows-latestto the Python CI workflow, enabling automated testing on Windows.Merge order: #3721 must merge first (library fix for drive letter parsing). This PR is branched on top of it.
Supersedes: #3722 (test fixes are now here instead of separate).
Depends on:
Changes
windows-unit-testjob (Python 3.12,windows-latest)Expected result
Locally verified: 3801 passed, 1 skipped, 0 failures on Windows.
Depends on #3721. Closes #2477.