Skip to content

Correct numpy compatibility please. #596

Description

@BBC-Esq

Currently your project says that it's compatible with "numpy>=1.25.0". However, ingesting vectors / creating an index fails on NumPy 2.4 and newer with: "AttributeError: module 'numpy' has no attribute 'in1d'".

This is because Numpy deprecated np.in1d in 2.0 and removed it in 2.4.0:

numpy/numpy#29978

https://github.com/numpy/numpy/releases/tag/v2.4.0

tiledb/vector_search/ingestion.py, inside ingest_flat() still calls the old `np.in1d'

np.isin is a direct replacement and takes the same arguments (including kind="sort")

Temporary workaround (for others hitting this before a release)

Run once at startup, before ingesting:

import numpy as np
if not hasattr(np, "in1d"):
    np.in1d = np.isin

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions