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

Partial date-property TTL updates reset an omitted offset to zero

Aperta Adatta ai principianti
#2,170 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api, backend

Direzione di ricerca

Il problema si trova nel metodo Reconfigure.ObjectTTL.delete_by_date_property(). Esamina il file weaviate/classes/config.py, individua questo metodo e osserva come fonde la configurazione. Lo script di riproduzione fornito mostra il problema. La correzione consiste nell'assicurarsi che un parametro ttl_offset omesso non ripristini un valore esistente a zero. Controlla i test esistenti nei moduli di test di configurazione per comprendere il comportamento atteso e aggiungi nuovi test per i casi di preservazione.

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

Descrizione

Description

Reconfigure.ObjectTTL.delete_by_date_property() changes an omitted ttl_offset to 0. A partial update intended only to change filter_expired_objects therefore overwrites an existing nonzero expiry offset. Other TTL update helpers preserve omitted values.

Reproduction

No running server is required to inspect the merged configuration sent by the client:

from weaviate.classes.config import Reconfigure

existing = {
    "enabled": True,
    "filterExpiredObjects": False,
    "deleteOn": "expiresAt",
    "defaultTtl": 3600,
}
update = Reconfigure.ObjectTTL.delete_by_date_property(filter_expired_objects=True)
print(update.merge_with_existing(existing))

Actual: defaultTtl becomes 0 while filterExpiredObjects becomes True.
Expected: defaultTtl remains 3600, since no new offset was supplied. An explicit ttl_offset=0 should still reset it.

This can change object expiry timing when the caller only intended to change filtering. The same issue applies to negative offsets.

Environment and validation

Main commit 142d798, Python 3.13.13, macOS arm64. The editable shallow checkout reports 0.1.dev1+g142d798a9.

A patch leaves None unchanged on the update path and clarifies the parameter documentation. Creation still defaults to zero. Tests cover merging positive and negative existing offsets, explicit integer/timedelta offsets including zero, and the creation default. The two preservation cases fail before the fix. Afterward, both configuration test modules pass (233 tests). No live-server integration test was run.

AI assistance was used to investigate, implement, and test this patch.

Lingua principale
Python
Stelle
227
Fork
151
Merge medio
1g 18h
PR unite (30g)
9

Guida per i contributori

Apri la guida per i contributori

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 weaviate/weaviate-python-client

Tutte le issue di weaviate/weaviate-python-client

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.