mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 07:45:17 +00:00
test(python): re-enable tests skipped on Windows that now pass (#5326)
Several Python tests are skipped on Windows, so the Windows CI job never
runs them. I ran them on Windows and they pass now, so this PR removes
the skips:
- `test_db.py`: the four `namespace_client` tests ("Namespace client
issues")
- `test_table.py`: `test_consistency` ("directory namespace is not
supported on Windows yet")
- `test_namespace_integration.py`:
`test_namespace_create_schema_only_with_provider`
- `docs/test_search.py`: the five FTS tests that pointed at
lancedb/lance#3905, which was closed in June 2025
Two of the `namespace_client` tests still failed on Windows, but only
because of how they checked the root. `namespace_id()` returns a Rust
debug string like `DirectoryNamespace { root: "C:\Users\..." }`, so the
backslashes are escaped and `str(tmp_path) in namespace_id()` was false.
The assertion now escapes them the same way first. On POSIX paths that
is a no-op, so the check is unchanged there.
No library code changes.
### Testing
On Windows 11, Python 3.12, with the `lancedb==0.42.1` wheel:
- The 17 re-enabled test cases pass. I ran them 6 times in a row and
they passed every time, including `test_consistency` with the 0.1 s
interval.
- Full suite (`-m "not slow and not s3_test"`): 4777 passed, 205
skipped, 0 failures.
- `ruff check` and `ruff format --check` pass.
I found this with help from Claude Code (Claude Opus 5.5) while running
the test suite on Windows. I checked each change and ran the tests
myself.
This commit is contained in:
@@ -156,9 +156,6 @@ async def test_vector_search_async():
|
||||
# --8<-- [end:search_result_async_as_list]
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
os.name == "nt", reason="Need to fix https://github.com/lancedb/lance/issues/3905"
|
||||
)
|
||||
def test_fts_fuzzy_query():
|
||||
uri = "data/fuzzy-example"
|
||||
db = lancedb.connect(uri)
|
||||
@@ -201,9 +198,6 @@ def test_fts_fuzzy_query():
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
os.name == "nt", reason="Need to fix https://github.com/lancedb/lance/issues/3905"
|
||||
)
|
||||
def test_fts_boost_query():
|
||||
uri = "data/boost-example"
|
||||
db = lancedb.connect(uri)
|
||||
@@ -249,9 +243,6 @@ def test_fts_boost_query():
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
os.name == "nt", reason="Need to fix https://github.com/lancedb/lance/issues/3905"
|
||||
)
|
||||
def test_fts_boolean_query(tmp_path):
|
||||
uri = tmp_path / "boolean-example"
|
||||
db = lancedb.connect(uri)
|
||||
@@ -303,9 +294,6 @@ def test_fts_boolean_query(tmp_path):
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
os.name == "nt", reason="Need to fix https://github.com/lancedb/lance/issues/3905"
|
||||
)
|
||||
def test_fts_native():
|
||||
# --8<-- [start:basic_fts]
|
||||
uri = "data/sample-lancedb"
|
||||
@@ -351,9 +339,6 @@ def test_fts_native():
|
||||
# --8<-- [end:fts_incremental_index]
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
os.name == "nt", reason="Need to fix https://github.com/lancedb/lance/issues/3905"
|
||||
)
|
||||
@pytest.mark.asyncio
|
||||
async def test_fts_native_async():
|
||||
# --8<-- [start:basic_fts_async]
|
||||
|
||||
@@ -7,7 +7,6 @@ import contextlib
|
||||
import inspect
|
||||
import pickle
|
||||
import re
|
||||
import sys
|
||||
from datetime import timedelta
|
||||
from importlib import resources
|
||||
import os
|
||||
@@ -1482,7 +1481,6 @@ def test_clone_table_deep_clone_fails(tmp_path):
|
||||
db.clone_table("cloned", source_uri, is_shallow=False)
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.platform == "win32", reason="Namespace client issues")
|
||||
def test_namespace_client_native_storage(tmp_path):
|
||||
"""Test namespace_client() returns DirectoryNamespace for native storage."""
|
||||
from lance.namespace import DirectoryNamespace
|
||||
@@ -1491,10 +1489,11 @@ def test_namespace_client_native_storage(tmp_path):
|
||||
ns_client = db.namespace_client()
|
||||
|
||||
assert isinstance(ns_client, DirectoryNamespace)
|
||||
assert str(tmp_path) in ns_client.namespace_id()
|
||||
# namespace_id() is a Rust debug string, which escapes the backslashes
|
||||
# in Windows paths.
|
||||
assert str(tmp_path).replace("\\", "\\\\") in ns_client.namespace_id()
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.platform == "win32", reason="Namespace client issues")
|
||||
def test_namespace_client_with_storage_options(tmp_path):
|
||||
"""Test namespace_client() preserves storage options."""
|
||||
from lance.namespace import DirectoryNamespace
|
||||
@@ -1506,7 +1505,6 @@ def test_namespace_client_with_storage_options(tmp_path):
|
||||
assert isinstance(ns_client, DirectoryNamespace)
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.platform == "win32", reason="Namespace client issues")
|
||||
def test_namespace_client_operations(tmp_path):
|
||||
"""Test that namespace_client() returns a functional namespace client."""
|
||||
db = lancedb.connect(tmp_path)
|
||||
@@ -1526,7 +1524,6 @@ def test_namespace_client_operations(tmp_path):
|
||||
assert "test_table" in table_names
|
||||
|
||||
|
||||
@pytest.mark.skipif(sys.platform == "win32", reason="Namespace client issues")
|
||||
def test_namespace_client_namespace_connection(tmp_path):
|
||||
"""Test namespace_client() returns the backing client for namespace connections."""
|
||||
from lance.namespace import DirectoryNamespace
|
||||
@@ -1535,4 +1532,6 @@ def test_namespace_client_namespace_connection(tmp_path):
|
||||
ns_client = db.namespace_client()
|
||||
|
||||
assert isinstance(ns_client, DirectoryNamespace)
|
||||
assert str(tmp_path) in ns_client.namespace_id()
|
||||
# namespace_id() is a Rust debug string, which escapes the backslashes
|
||||
# in Windows paths.
|
||||
assert str(tmp_path).replace("\\", "\\\\") in ns_client.namespace_id()
|
||||
|
||||
@@ -20,7 +20,6 @@ Tests verify:
|
||||
import copy
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import uuid
|
||||
@@ -391,10 +390,6 @@ def test_namespace_open_table_with_provider(s3_bucket: str, use_custom: bool):
|
||||
assert get_describe_call_count(inner_ns_client) == describe_count_after_open
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
sys.platform == "win32",
|
||||
reason="TODO: fix schema-only namespace metrics test on Windows",
|
||||
)
|
||||
@pytest.mark.parametrize("use_custom", [False, True], ids=["DirectoryNS", "CustomNS"])
|
||||
def test_namespace_create_schema_only_with_provider(use_custom: bool):
|
||||
"""
|
||||
|
||||
@@ -6012,13 +6012,6 @@ def test_hybrid_search_metric_type(tmp_db: DBConnection):
|
||||
@pytest.mark.parametrize(
|
||||
"consistency_interval", [None, timedelta(seconds=0), timedelta(seconds=0.1)]
|
||||
)
|
||||
@pytest.mark.skipif(
|
||||
sys.platform == "win32",
|
||||
reason=(
|
||||
"TODO: directory namespace is not supported on Windows yet; "
|
||||
"re-enable after that is fixed."
|
||||
),
|
||||
)
|
||||
def test_consistency(tmp_path, consistency_interval):
|
||||
db = lancedb.connect(tmp_path)
|
||||
table = db.create_table("my_table", data=[{"id": 0}])
|
||||
|
||||
Reference in New Issue
Block a user