Skip to content

[Bug] Incorrect typing in IndexAsyncio.query method for filter parameter. #461

@DevParapalli

Description

@DevParapalli

Is this a new bug?

  • 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

Not necessarily, but I encountered it while converting my code to use v6

Describe the bug
Filter parameter is typed to accept only {'$eq':'value'} rather than {'key':{'$eq':'value'}}

Error information
No errors, just a typing issue.

Steps to reproduce the issue locally

async def vdb_entity_query(vector: list[float], namespace: str, entity: str, top_k: int = 1):
    async with PineconeAsyncio(os.getenv("PINECONE_API_KEY")).IndexAsyncio(host=__HOST_ADDR__) as index:
        return await index.query(
            vector=vector,
            top_k=top_k,
            namespace=namespace,
            include_metadata=True,
            include_values=False,
            filter={"entity":{"$eq": entity}}, 
        )

Environment

  • OS Version: Microsoft Windows 11 Enterprise 10.0.22000 Build 22000
  • Python version: 3.12.9
  • Python SDK version: 6.0.1

Additional context
I do not like red squiggly lines under my code.

Metadata

Metadata

Assignees

Labels

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions