Skip to content

CI: Add Windows unit test job - #3723

Open
qzyu999 wants to merge 2 commits into
apache:mainfrom
qzyu999:add-windows-ci-job
Open

CI: Add Windows unit test job#3723
qzyu999 wants to merge 2 commits into
apache:mainfrom
qzyu999:add-windows-ci-job

Conversation

@qzyu999

@qzyu999 qzyu999 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Rationale

Adds windows-latest to 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

  • Add windows-unit-test job (Python 3.12, windows-latest)
  • Fix test platform assumptions (MAX_PATH, file locking, path formats, SQLite URIs)
  • Skip Kerberos tests on Windows (C lib unavailable)
  • Skip Rich box-rendering tests on Windows (terminal-dependent formatting)

Expected result

Locally verified: 3801 passed, 1 skipped, 0 failures on Windows.

Depends on #3721. Closes #2477.

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 Fokko 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.

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.

Comment thread tests/io/test_pyarrow.py
Comment thread tests/io/test_pyarrow.py Outdated
Comment thread tests/conftest.py Outdated
@qzyu999
qzyu999 force-pushed the add-windows-ci-job branch from e4f7648 to 7fa2b4a Compare August 2, 2026 19:11
Comment thread tests/io/test_pyarrow.py Outdated
with pytest.raises(OSError) as exc_info:
r.seek(0, 0)
assert "only valid on seekable files" in str(exc_info.value)
try:

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.

Suggested change
try:
with input_file.open(seekable=True) as r:

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.
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.

infra: run tests for windows

2 participants