Repository navigation
Description
Task
Remove the 0.7 call forms that raise DeprecationWarning since 0.8.0. They are restored at
import time by one marked section of python_bindings/__init__.py
(# --- 0.8 compatibility layer; remove in 0.9).
| Class | 0.7 form (removed) | 0.8 form |
|---|---|---|
IvfIndex |
IvfIndex(dim, max_elements, num_clusters, nbits, metric=..., initializer=...), including max_elements= by keyword |
IvfIndex(dim, num_clusters, nbits=..., metric=..., initializer=..., seed=...) |
HnswIndex |
HnswIndex(dim, max_elements, M, ef_construction, nbits, metric, random_seed), including max_elements= by keyword |
HnswIndex(dim, nbits=..., num_clusters=..., M=..., ef_construction=..., metric=..., seed=...); capacity grows on add |
HnswIndex |
random_seed= |
seed= |
IvfIndex, HnswIndex |
build(data, centroids, cluster_ids, num_threads=1, fast_quantization=False) |
set_centroids(centroids) or train(data), then add(data, cluster_ids=..., num_threads=...) |
IvfIndex, HnswIndex |
add(data, cluster_ids, num_threads, fast_quantization) by position |
the same options by keyword |
IvfIndex, HnswIndex |
is_built |
is_trained or len(index) |
SymqgIndex |
SymqgIndex(dim, max_degree, metric, quantization_bits) by position |
SymqgIndex(dim, max_degree=..., metric=..., nbits=...) |
SymqgIndex |
quantization_bits= (0 for raw vectors) |
nbits= (32 for raw vectors) |
SymqgIndex |
build(data, ef_construction, num_threads=1, init="pipnn") |
SymqgIndex(..., ef_construction=..., init=...), then one add(data) |
SymqgIndex |
search_batch(queries, k, ef, num_threads=1) |
search(queries, k, ef, num_threads=...) |
SymqgIndex |
quantization_bits property, is_built |
nbits, len(index) |
#232 renames some of the 0.8 names in this table again for 0.9 (initializer to routing, ef to
ef_search); the migration guide lists both steps.
Also remove what only these forms use:
- the private native hooks:
_max_elements=on the nativeIvfIndex/HnswIndexconstructors,
random_seed=on the nativeHnswIndexconstructor,_buildon all three classes, and
SymqgIndex._quantization_bits; - the
@deprecatedoverloads and members inpython_bindings/__init__.pyi, and the
"0.7 forms ... still work in 0.8" notes in the docstrings; tests/python/test_compat_08.py, and the 0.7 rows of the
migration guide, which
should say the forms were removed in 0.9.
After removal each old form must fail with a plain TypeError (or AttributeError for removed
members), not a crash or a silent reinterpretation; for example IvfIndex(dim, 1000, 64) must
not be read as num_clusters=1000.
Gate
The main Python downstream, txtai, still uses these forms at
its current master (checked at baecd74, 2026-11-01: IvfIndex(dim=..., max_elements=..., num_clusters=...), HnswIndex(..., max_elements=..., random_seed=...),
build(vectors, centroids, clusterids)) and detects missing results with
uid != 0xFFFFFFFF. 0.9 should ship only after a txtai release that:
- builds with
set_centroids(centroids)+add(vectors, cluster_ids=...)(or the firstadd), - filters missing results with
np.isfinite(distances), which also works after 64-bit IDs, with -1 for missing results #211, - passes
None, not0, when noefis configured (Python index API consistency: capacity, seed, search arguments, routing,ef_search#232), and - asserts
num_stored_pointsinstead ofmax_elementsin its tests (Python index API consistency: capacity, seed, search arguments, routing,ef_search#232).
txtai 9.14.0 requires rabitqlib>=0.5.1 and its default branch rabitqlib>=0.7.0, both with no upper bound, so txtai 9.14.0 and earlier will install
0.9 and fail; the 0.9 release notes must name the first compatible txtai release.
tests/python/test_txtai_compat.py follows txtai's new calls once that release exists.
Prerequisite
#214 (tests off the 0.7 forms).
Activity
feat(python): use int64 point IDs with -1 for missing results
gouyt13 commentedon Nov 14, 2026
Progress: #239 (open, targets
dev/0.9) removes every form in the table above, with the private native hooks, the deprecated stub overloads andtests/python/test_compat_08.py. Each removed form now raises a plainTypeErrororAttributeError; for example,IvfIndex(dim, 1000, 64)is an error.tests/python/test_txtai_compat.pynow makes the four calls listed under Gate; the same test passes without warnings on 0.8.5.The removal needs no further contribution. Still open, so this issue stays open until 0.9 is released:
gouyt13 commentedon Nov 19, 2026
Update: #239, listed as open in the progress comment above, was merged into
dev/0.9on 2026-11-14 (3685e81). This issue stays open until 0.9 is released.test(python): migrate ten test files off the 0.7 call forms
gouyt13 commentedon Nov 23, 2026
Released in 0.9.0. As promised here, it waited for a txtai release on the 0.8 API: txtai 9.15.0, with neuml/txtai#1616, works with 0.9.0 and with 0.8.5. The release notes name it, and keep
rabitqlib<0.9for txtai 9.14.0. The downstream check ran txtai's RaBitQ tests and a recall comparison against the 9.15.0 tag; after the release, the same tests pass with the 0.9.0 wheel from PyPI.feat(python)!: remove the 0.7 and 0.8 forms and expose the 0.9 names …