Partial date-property TTL updates reset an omitted offset to zero
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
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
- 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 weaviate/weaviate-python-client
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
weaviate/weaviate-python-client#1002 · 5 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 15/100
weaviate/weaviate-python-client#2165 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
weaviate/weaviate-python-client#2154 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
weaviate/weaviate-python-client#2150 ·
-
Batch stream recovery closes the shared connection and can leave the client permanently closed Apertabug
weaviate/weaviate-python-client#2139 · 1 assegnatario ·
Tutte le issue di weaviate/weaviate-python-client
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·