Skip to content

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

Description

@HuaTNA

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions