Python raises a bare TypeError for a misspelled option where TypeScript raises unknown_key
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python, typescript
- Ambito
- backend-api-design
Direzione di ricerca
Start with src/selfgraph/client.py and compare methods such as entities.update that already use check_options; then inspect public method signatures in src/selfgraph/resources/*.py and src/selfgraph/insert.py. Reproduce the listed typos in both SDKs and trace how options reach validation. Done means unknown options across the listed Python constructors and methods raise unknown_key with a field and, where available, a suggestion.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
A misspelled option on most Python methods raises the interpreter's TypeError, which has no code, field, or hint. The same call in TypeScript raises unknown_key with the field and a suggestion:
| Call | Python | TypeScript |
|---|---|---|
SelfGraph(store=s, scheme={}) |
TypeError: SelfGraph.__init__() got an unexpected keyword argument 'scheme' |
unknown_key, field scheme: unknown option 'scheme' for SelfGraph; did you mean 'schema'? |
g.entities.list(limt=5) |
TypeError |
unknown_key, field limt, did you mean 'limit'? |
g.entities.create("X", "P", alias=["x"]) |
TypeError |
unknown_key, field alias, did you mean 'aliases'? |
g.retrieve("Ada", dept=2) |
TypeError |
unknown_key, field dept, did you mean 'depth'? |
g.insert.facts({}, sourceid="s") |
TypeError |
unknown_key, field sourceid, did you mean 'source_id'? |
g.maintenance.decay(halflife=1) |
TypeError |
unknown_key, field halflife |
It is the same for entities.get, entities.delete, relations.create, relations.list, relations.certify, preferences.create, decisions.create, insert.text, check_answerable, run_cypher, maintenance.prune, and diff.
Python already does this for some calls: entities.update(nam=...), relations.update(properties=...), and SelfGraph.connect(stor=...) raise unknown_key with did you mean. So code that catches SelfGraphError handles a typo on those calls but crashes on all the others. An agent reading code gets nothing.
Reproduce
On 04862c4, run any call in the table in both SDKs.
Expected
unknown_key with field and did you mean for an unknown option on every public method and constructor, as in TypeScript. For example, take **options and run them through check_options, the way entities.update does.
Where
src/selfgraph/client.py,SelfGraph.__init__,retrieve,check_answerable,run_cypher,diffsrc/selfgraph/resources/*.pyandsrc/selfgraph/insert.py, the method signatures
- Lingua principale
- TypeScript
- Stelle
- 173
- Fork
- 58
- Merge medio
- 6h
- PR unite (30g)
- 120
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hydra-db/selfgraph
-
approved-for-pr area: cli-mcp area: errors bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
hydra-db/selfgraph#401 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: errors area: store bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
hydra-db/selfgraph#398 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: errors area: write bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
hydra-db/selfgraph#392 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: parity area: write bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hydra-db/selfgraph#391 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hydra-db/selfgraph
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
code-yeongyu/senpi#7139 ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
lingdojo/kana-dojo#34395 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mastra-ai/mastra#31093 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:web p2 product:business triage:active type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
cuadrao-ai/argus#2328 ·
I maintainer di solito rispondono entro 1 giorno
-
bug frontend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
nikhilb2/simple_invoicing#907 ·