1313from zvec .typing import DataType , StatusCode , MetricType , QuantizeType
1414import zvec
1515
16-
17- # Cache the DiskAnn plugin preload status so we pay the load cost once per
18- # test session. The plugin normally auto-loads on first DiskAnn use, but we
19- # preload it explicitly here so a missing libaio / misplaced plugin .so
20- # surfaces as a clear pytest skip instead of a confusing
21- # "Create vector column indexer failed" deep inside the collection code path.
2216_DISKANN_PRELOAD_REASON : str | None = None
2317_DISKANN_PRELOAD_DONE : bool = False
2418
2519
2620def _ensure_diskann_runtime_or_reason () -> str | None :
27- """Preload the DiskAnn plugin and return None on success or a human-readable
28- skip reason on failure. Idempotent across calls."""
21+ """Check whether DiskAnn is available on this platform and return None
22+ on success or a human-readable skip reason on failure. Idempotent across
23+ calls."""
2924 global _DISKANN_PRELOAD_DONE , _DISKANN_PRELOAD_REASON
3025 if _DISKANN_PRELOAD_DONE :
3126 return _DISKANN_PRELOAD_REASON
@@ -35,22 +30,6 @@ def _ensure_diskann_runtime_or_reason() -> str | None:
3530 _DISKANN_PRELOAD_REASON = "DiskAnn only supported on Linux x86_64"
3631 return _DISKANN_PRELOAD_REASON
3732
38- if not zvec .is_libaio_available ():
39- _DISKANN_PRELOAD_REASON = (
40- "libaio is not available on this host; DiskAnn cannot run. "
41- "Install libaio1 (or libaio1t64 on Ubuntu 24.04+) and retry."
42- )
43- return _DISKANN_PRELOAD_REASON
44-
45- status = zvec .load_diskann_plugin ()
46- if status != zvec .DISKANN_PLUGIN_OK :
47- _DISKANN_PRELOAD_REASON = (
48- f"Failed to load DiskAnn plugin (status={ status } ); "
49- "check that libzvec_diskann_plugin.so is installed alongside "
50- "_zvec.so in the Python site-packages directory."
51- )
52- return _DISKANN_PRELOAD_REASON
53-
5433 _DISKANN_PRELOAD_REASON = None
5534 return None
5635
@@ -148,8 +127,7 @@ def full_schema_new(request) -> CollectionSchema:
148127 else :
149128 nullable , has_index , vector_index = True , False , HnswIndexParam ()
150129
151- # Skip DiskAnn tests on unsupported platforms or when the runtime cannot
152- # be brought up (missing libaio, plugin .so not installed, etc.).
130+ # Skip DiskAnn tests on unsupported platforms.
153131 from zvec .model .param import DiskAnnIndexParam
154132
155133 if isinstance (vector_index , DiskAnnIndexParam ):
0 commit comments