Skip to content

[Bug] Incompatible change: array[float] no longer accepted by type signature #511

Open
@charles-dyfis-net

Description

@charles-dyfis-net

Is this a new bug?
In pinecone-client 5.0.1, an array[float] could be used when creating indexes.

In version 7.0.2, this may still work in practice with type-checking overridden; however, the type definitions indicate that only List[float] is permitted, and array does not satisfy List, so previously-legal values are no longer accepted.

  • I believe this is a new bug
  • I have searched the existing Github issues and Community Forum, and I could not find an existing post for this bug

Steps to reproduce the issue locally

Run the following code through type-checking with pyright:

from array import array
import pinecone

embedding_bytes = b'' # in real-world scenarios this of course will be non-empty
embedding_arr = array("f", embedding_bytes)

pc = pinecone.Pinecone()
idx = pc.Index(name="test")
idx.upsert(vectors=[("name", embedding_arr)])

It will fail as follows:

error: Argument of type "list[tuple[str, array[float]]]" cannot be assigned to parameter "vectors" of type "List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict]" in function "upsert"
    "tuple[str, array[float]]" is not assignable to "Vector" (reportArgumentType)
1 error, 0 warnings, 0 informations

Environment

  • OS Version: NixOS 25.05
  • Python version: 3.12.19
  • Python SDK version: 7.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus:needs-triageAn issue that needs to be triaged by the Pinecone team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions