entities.evidence/relations.evidence with a cursor returns empty instead of NotFoundError for an unknown id

Aperta
#394 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, typescript

Direzione di ricerca

Read src/selfgraph/_ops.py around list_evidence and typescript/src/ops.ts around listEvidence; compare how each handles an unknown target when a cursor decodes to a nonzero offset. Check the existing evidence tests and add coverage for both entities and relations in each SDK. Done means unknown IDs raise NotFoundError with and without a cursor in both SDKs.

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

Descrizione

approved-for-pr area: errors area: retrieval bug effort: S P3

Summary

entities.evidence and relations.evidence raise NotFoundError for an unknown id on the first page, but return an empty page for the same unknown id when a cursor is passed. The docs say evidence raises NotFoundError for an unknown id, without a first-page caveat.

Reproduction (0.2.2, Kuzu backend)

await g.entities.evidence("person:nosuch")
# NotFoundError (as documented)

await g.entities.evidence("person:nosuch", cursor="NTA=")   # any decodable offset cursor
# returns an empty Page, no error

# relations.evidence behaves the same way.

Cause

list_evidence in src/selfgraph/_ops.py (around lines 738 to 762) runs the existence check only when skip == 0:

if not rows and skip == 0:
    ... raise NotFoundError ...

A cursor decodes to skip > 0, so the check is skipped and an unknown target yields an empty page instead of the error. The TypeScript port is the same (listEvidence in typescript/src/ops.ts, if (!rows.length && skip === 0)), so both SDKs share it.

Expected

evidence raises NotFoundError for an unknown entity or relation id regardless of the cursor, matching the documented contract, in both SDKs.

Lingua principale
TypeScript
Stelle
173
Fork
58
Merge medio
6h
PR unite (30g)
120

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 hydra-db/selfgraph

Tutte le issue di hydra-db/selfgraph

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.