Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ 初心者向け
#2,170 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@HuaTNA がすでに取り組んでいます。

2026年9月23日 から。

  • #2171 @HuaTNA による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
api, backend

調査の方向性

問題は Reconfigure.ObjectTTL.delete_by_date_property() メソッドにあります。weaviate/classes/config.py ファイルを確認し、このメソッドを見つけて、設定をどのようにマージするかを調べてください。提供された再現スクリプトが問題を示しています。修正は、省略された ttl_offset パラメータが既存の値をゼロにリセットしないようにすることです。設定テストモジュールの既存のテストを確認して期待される動作を理解し、保持ケースの新しいテストを追加してください。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
228
フォーク
158
平均マージ
2日 9時間
マージ済み PR(30日)
12

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

weaviate/weaviate-python-client のほかの issue

weaviate/weaviate-python-client の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。