Description
Reconfigure.ObjectTTL.delete_by_date_property() changes an omitted ttl_offset to 0. A call that only supplies filter_expired_objects consequently includes an explicit defaultTtl: 0 in the generated TTL update block. Other TTL update helpers leave an omitted offset as None.
Reproduction
This inspects the TTL update block locally; it does not test the complete collection update request or server behavior:
from weaviate.classes.config import Reconfigure
update = Reconfigure.ObjectTTL.delete_by_date_property(filter_expired_objects=True)
print(update.defaultTtl)
print(update.merge_with_existing({}))
# Actual: 0 and {'enabled': True, 'filterExpiredObjects': True, 'defaultTtl': 0}
# Expected: None and {'enabled': True, 'filterExpiredObjects': True}
existing = {
'enabled': True,
'filterExpiredObjects': False,
'deleteOn': 'expiresAt',
'defaultTtl': 3600,
}
print(update.merge_with_existing(existing))
The direct TTL-block merge overwrites defaultTtl with zero even though no offset was supplied. An explicit ttl_offset=0 should still reset it. Negative existing offsets have the same issue.
Scope clarification from review
Review on #2171 identified a separate casing mismatch: the collection update path uses objectTTLConfig, while creation and reading use objectTtlConfig. A local collection merge with the latter spelling produces two blocks. The original reproduction above operates on an individual TTL block and cannot establish server-side preservation. The delete_by_* factories also set enabled=True, even for a filter-only call. Those existing behaviors need a maintainer decision before the offset fix lands.
Environment and validation
Originally reproduced on main commit 142d798, Python 3.13.13, macOS arm64. The offset coercion and related collection-key/activation paths remain present in upstream eb5546a8 inspected on 2026-09-29.
PR #2171 leaves None unchanged in the update factory; creation still defaults to zero. Revised regression tests verify offset omission directly, positive/negative TTL-block merges, explicit integer/timedelta offsets including zero, and the creation default. Restoring the coercion gives two failures; with the fix 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 and review follow-up.
Description
Reconfigure.ObjectTTL.delete_by_date_property()changes an omittedttl_offsetto0. A call that only suppliesfilter_expired_objectsconsequently includes an explicitdefaultTtl: 0in the generated TTL update block. Other TTL update helpers leave an omitted offset asNone.Reproduction
This inspects the TTL update block locally; it does not test the complete collection update request or server behavior:
The direct TTL-block merge overwrites
defaultTtlwith zero even though no offset was supplied. An explicitttl_offset=0should still reset it. Negative existing offsets have the same issue.Scope clarification from review
Review on #2171 identified a separate casing mismatch: the collection update path uses
objectTTLConfig, while creation and reading useobjectTtlConfig. A local collection merge with the latter spelling produces two blocks. The original reproduction above operates on an individual TTL block and cannot establish server-side preservation. Thedelete_by_*factories also setenabled=True, even for a filter-only call. Those existing behaviors need a maintainer decision before the offset fix lands.Environment and validation
Originally reproduced on main commit
142d798, Python 3.13.13, macOS arm64. The offset coercion and related collection-key/activation paths remain present in upstreameb5546a8inspected on 2026-09-29.PR #2171 leaves
Noneunchanged in the update factory; creation still defaults to zero. Revised regression tests verify offset omission directly, positive/negative TTL-block merges, explicit integer/timedelta offsets including zero, and the creation default. Restoring the coercion gives two failures; with the fix 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 and review follow-up.