AnswerDotAI / AnswerDotAI/apswutils

Use specific error for exceptions raised by create_scalar_function

Aperta
#3 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
3
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Typically APSW has more precise errors than Sqlite3, this is one of the exceptions.

When using `create_scalar_function` in `deterministic mode`, it is possible to throw an exception based on Sqlite constraints. In sqlite3 this raises a `sqlite.NotSupportedError`, but there is nothing specific in APSW. In fact, we're not sure what error is raised, so we lump it under `apsw.Error`. Some better things we can do:

1. Figure the specific error and capture/raise that as necessary
2. If there is no specific error, open a ticket, submit a PR to the upstream APSW library

> [!NOTE]
> This is documented as a comment in the `register_function` code within this library

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia leggendo il commento nel codice di register_function e riproducendo un’eccezione da create_scalar_function in modalità deterministica. Confronta l’eccezione con sqlite3.NotSupportedError e verifica come vengono attualmente catturati gli errori APSW. Il lavoro è completato quando viene sollevato un errore APSW specifico, se disponibile, oppure quando l’errore mancante viene documentato e portato all’attenzione del progetto APSW upstream.

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

Valutazione

Stack tecnologico
python, sqlite
Ambito
databases
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.