[Bug] [python] ChromaVectorStore.get truncates explicitly requested IDs

Aperta
#1,394 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
database

Direzione di ricerca

Read the BaseVectorStore.get contract in python/flink_agents/api/vector_stores/vector_store.py and the adapter implementation in python/flink_agents/integrations/vector_stores/chroma/chroma_vector_store.py. The report includes a direct reproduction for explicit IDs and a scan without IDs; begin by checking how the adapter forwards limit. Done means requested existing IDs are all returned regardless of limit, while scans still honor limit, with regression tests covering both cases.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug priority/major
Search before asking
  • I searched in the issues and found nothing similar.
Description

The public BaseVectorStore.get contract states that when ids is supplied, the ID selection bounds the result and limit is effectively ignored.

The Python Chroma adapter always forwards limit, including the default of 100. Consequently, requesting 101 existing IDs returns 100 documents. Requesting two existing IDs with limit=1 returns one document. Supplying limit=None returns all requested documents.

This can silently omit explicitly requested documents during batch reads. A scan without IDs should continue to respect its limit.

I would like to work on this fix and have prepared a local patch with regression tests. The proposed scope is to ignore the scan limit when IDs are supplied, while retaining filtering and bounded scans. Could a committer confirm whether this approach is appropriate? Please assign the issue to me if that fits the project's workflow.

Related code

How to reproduce

Use the current source checkout with its Python package on PYTHONPATH and the declared Chroma dependency installed.

from flink_agents.api.vector_stores.vector_store import Document
from flink_agents.integrations.vector_stores.chroma.chroma_vector_store import (
    ChromaVectorStore,
)

store = ChromaVectorStore(
    name="explicit_ids_probe",
    embedding_model="unused",
    collection="explicit_ids_probe",
)
ids = [str(i) for i in range(101)]
store.add([
    Document(
        id=doc_id,
        content="sample",
        metadata={"category": "a"},
        embedding=[1.0, 0.0],
    )
    for doc_id in ids
])

print(len(store.get(ids=ids, limit=None)))   # 101
print(len(store.get(ids=ids)))               # actual 100, expected 101
print(len(store.get(ids=ids[:2], limit=1)))  # actual 1, expected 2
print(len(store.get(limit=1)))               # 1, expected 1

The adapter uses a local ephemeral Chroma client. The vectors are precomputed, so this reproduction requires no embedding service or LLM.

Version and environment
  • Apache Flink Agents main at 5b0b5531657aacb050201056ebc717fc8e683f09
  • Windows, Python 3.12.1
  • ChromaDB 1.0.21
  • Pydantic 2.12.5
  • Reproduced through the adapter directly without a Flink cluster
Are you willing to submit a PR?
  • I'm willing to submit a PR!
Lingua principale
Java
Stelle
491
Fork
184
Merge medio
1g 17h
PR unite (30g)
69

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/flink-agents

Tutte le issue di apache/flink-agents

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.