Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Date conversion recipes do not apply errors= handling to parser overflows

Aperta Adatta ai principianti
#857 0 commenti 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
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, sqlite
Ambito
database

Direzione di ricerca

Individua le ricette parsedate() e parsedatetime() e i relativi test esistenti; inizia leggendo come gestiscono ParserError e le modalità errors=. Aggiungi la copertura per i valori di data numerici troppo grandi in entrambe le ricette con SET_NULL e IGNORE, verificando al contempo che il comportamento predefinito continui a rilanciare OverflowError.

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

Descrizione

parsedate() and parsedatetime() support errors=r.IGNORE and errors=r.SET_NULL for values that cannot be parsed, but they currently only catch dateutil.parser.ParserError.

dateutil.parser.parse() can also raise OverflowError for malformed values with numeric components too large for the underlying date representation. For example:

from sqlite_utils import recipes

value = "999999999999999999999999999999-01-01"
recipes.parsedate(value, errors=recipes.SET_NULL)

Currently this raises OverflowError instead of returning None. The same happens with parsedatetime(), and errors=recipes.IGNORE also fails to return the original value.

A focused fix would treat OverflowError the same as ParserError inside these two recipes while preserving the existing default behavior of re-raising when errors is not set. Targeted tests can cover both recipes and both error-handling modes.

Lingua principale
Python
Stelle
2.2k
Fork
172
Merge medio
9m
PR unite (30g)
1

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 simonw/sqlite-utils

Tutte le issue di simonw/sqlite-utils

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.