Skip to content

Commit 139edd4

Browse files
cayetanobvclaude
andcommitted
fix(ci): skip SQLite-backed tests on Windows (upstream PyIceberg bug)
PyIceberg's SQL catalog resolves file:// warehouse URIs incorrectly on Windows, producing paths like /C:/Users/... which PyArrow rejects. Upstream issues: - apache/iceberg-python#1005 (closed, fix never merged) - apache/iceberg-python#2477 (Windows CI not supported) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 76b9466 commit 139edd4

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎tests/conftest.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
"""Shared test fixtures for portolake tests."""
22

3+
import sys
4+
35
import pyarrow as pa
46
import pyarrow.parquet as pq
57
import pytest
68
from pyiceberg.catalog import load_catalog
79

10+
# PyIceberg's SQL catalog resolves file:// warehouse URIs incorrectly on Windows,
11+
# producing paths like /C:/Users/... which PyArrow's local filesystem rejects.
12+
# Upstream: https://github.com/apache/iceberg-python/issues/1005 (closed, fix never merged)
13+
# PyIceberg doesn't run CI on Windows: https://github.com/apache/iceberg-python/issues/2477
14+
815

916
@pytest.fixture
1017
def iceberg_catalog(tmp_path):
1118
"""Create a temporary Iceberg catalog backed by SQLite."""
19+
if sys.platform == "win32":
20+
pytest.skip(
21+
"PyIceberg SQL catalog warehouse paths broken on Windows"
22+
" (https://github.com/apache/iceberg-python/issues/1005)"
23+
)
1224
warehouse_uri = (tmp_path / "warehouse").as_uri()
1325
return load_catalog(
1426
"test",

‎tests/test_config.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
"""Tests for catalog configuration and creation."""
22

3+
import sys
34
from pathlib import Path
45

56
import pytest
67

78
from portolake.config import _default_properties, create_catalog
89

10+
_skip_windows_sqlite = pytest.mark.skipif(
11+
sys.platform == "win32",
12+
reason="PyIceberg SQL catalog warehouse paths broken on Windows (apache/iceberg-python#1005)",
13+
)
14+
915

1016
@pytest.mark.unit
1117
def test_default_properties_returns_sql_type():
@@ -43,6 +49,7 @@ def test_default_properties_without_catalog_root_uses_cwd():
4349
assert cwd in props["warehouse"]
4450

4551

52+
@_skip_windows_sqlite
4653
@pytest.mark.integration
4754
def test_create_catalog_with_catalog_root(tmp_path, monkeypatch):
4855
"""create_catalog(catalog_root=path) should create iceberg.db under path/.portolan/."""
@@ -55,6 +62,7 @@ def test_create_catalog_with_catalog_root(tmp_path, monkeypatch):
5562
assert (tmp_path / ".portolan" / "iceberg.db").exists()
5663

5764

65+
@_skip_windows_sqlite
5866
@pytest.mark.integration
5967
def test_create_catalog_returns_catalog_instance(tmp_path, monkeypatch):
6068
"""create_catalog() should return a working Catalog instance."""
@@ -72,6 +80,7 @@ def test_create_catalog_returns_catalog_instance(tmp_path, monkeypatch):
7280
assert isinstance(catalog, Catalog)
7381

7482

83+
@_skip_windows_sqlite
7584
@pytest.mark.integration
7685
def test_pyiceberg_env_vars_override_defaults(tmp_path, monkeypatch):
7786
"""PyIceberg env vars should override default properties."""

0 commit comments

Comments
 (0)