jsonquerylang / jsonquerylang/jsonquery-python
Custom functions not found in nested conditions
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 55
- Fork
- 3
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
The following code, derived from example4_custom_functions.py errors, since the parser can't find the custom function.
def times(value):
return lambda array: list(map(lambda item: item * value, array))
query = "true and times([1, 2, 3])"
options: JsonQueryOptions = {"functions": {"times": times}}
print(jsonquery(data, query, options))
Peeking at the code, it would seem that the custom arguments passed on the higher lever evaluation are not passed to recursive evaluations, and thus the function is not found.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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.
Direzione di ricerca
Inizia con example4_custom_functions.py e riproduci il fallimento usando la condizione annidata true and times([1, 2, 3]). Traccia il modo in cui le funzioni personalizzate vengono passate alle valutazioni ricorsive. Il lavoro è completato quando la funzione times fornita viene trovata e la query viene valutata correttamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- backend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100