Skip to content

Remove the deprecated 0.7 Python call forms #213

Closed

Description

@gouyt13

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 native IvfIndex/HnswIndex constructors,
    random_seed= on the native HnswIndex constructor, _build on all three classes, and
    SymqgIndex._quantization_bits;
  • the @deprecated overloads and members in python_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:

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

  1. added this to the 0.9 milestone on Nov 2, 2026
  2. added
    enhancement
    python
    on Nov 2, 2026
  3. gouyt13 commented on Nov 14, 2026

    @gouyt13
    MemberAuthor

    Progress: #239 (open, targets dev/0.9) removes every form in the table above, with the private native hooks, the deprecated stub overloads and tests/python/test_compat_08.py. Each removed form now raises a plain TypeError or AttributeError; for example, IvfIndex(dim, 1000, 64) is an error.

    tests/python/test_txtai_compat.py now 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:

    • the txtai release that makes those four changes;
    • naming that release in the 0.9 notes and on the txtai integration page.
  4. gouyt13 commented on Nov 19, 2026

    @gouyt13
    MemberAuthor

    Update: #239, listed as open in the progress comment above, was merged into dev/0.9 on 2026-11-14 (3685e81). This issue stays open until 0.9 is released.

  5. gouyt13 commented on Nov 23, 2026

    @gouyt13
    MemberAuthor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpython

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions