Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Object TTL update sends `objectTTLConfig`, while the server spells it `objectTtlConfig`

Đã đóng Phù hợp với người mới
#2,178 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Kayvan-Zahiri đang làm issue này rồi.

Từ ngày 2/10/2026.

  • #2181 của @Kayvan-Zahiri — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
62/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api

Hướng nghiên cứu

Đọc năm vị trí xuất hiện của khóa TTL trong weaviate/collections/classes/config.py, đặc biệt là logic merge quanh các dòng 1748-1750. Thêm một regression test để cố định cách viết ở phía server và objectTtlConfig, rồi chạy các test liên quan cùng với python -m pytest test/; hoàn tất khi PUT chứa một block duy nhất có tên chính xác và giữ nguyên hành vi hiện có.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

collection.config.update(object_ttl_config=...) merges the update into the schema it fetched, under a different key than the one the server returns. The server names the field objectTtlConfig, in schema.json#L1824 and in the Go tag at class.go#L50. The client writes objectTTLConfig here:

https://github.com/weaviate/weaviate-python-client/blob/38f30c11cd7531da5ab61246d56aa61410cca11c/weaviate/collections/classes/config.py#L1748-L1750

The PUT carries both blocks:

from weaviate.classes.config import Reconfigure
from weaviate.collections.classes.config import _CollectionConfigUpdate

stored = {"objectTtlConfig": {"enabled": True, "deleteOn": "expiresAt", "defaultTtl": 3600, "filterExpiredObjects": False}}
update = _CollectionConfigUpdate(
    object_ttl_config=Reconfigure.ObjectTTL.delete_by_date_property(property_name="customDate", filter_expired_objects=True)
)
print(update.merge_with_existing(stored))
# main 38f30c1
{'objectTtlConfig': {'enabled': True, 'deleteOn': 'expiresAt', 'defaultTtl': 3600, 'filterExpiredObjects': False}, 'objectTTLConfig': {'enabled': True, 'filterExpiredObjects': True, 'deleteOn': 'customDate', 'defaultTtl': 0}}

The update still reaches the server for two reasons. Go's encoding/json matches keys without regard to case, and the client puts its key last, so it overlays the stale block. With the two blocks in the other order, a live server stores nothing from the update:

# raw PUT /v1/schema/<class> against semitechnologies/weaviate:1.39.7, update block {'enabled': True, 'filterExpiredObjects': True}
A  both blocks, objectTTLConfig last     200  stored filterExpiredObjects=True
B  both blocks, objectTTLConfig first    200  stored filterExpiredObjects=False
C  only objectTtlConfig, fully merged    200  stored filterExpiredObjects=True

A rename of the five occurrences to objectTtlConfig sends one block and stores the same state as main. python -m pytest test/ gives 526 passed, as on main without it, and the five TTL integration tests pass against 1.39.7. On top of #2171's head the PUT carries one block with defaultTtl: 3600, and test/ gives 496 passed, as on that head alone. No test pins either spelling today.

#2171 lists this mismatch as awaiting a maintainer decision. Related: #2170.

@g-despot do you want the rename, with a test that pins objectTtlConfig, as a pull request? cc @dirkkul, as the key came in with ef6e0e3.

Ngôn ngữ chính
Python
Star
228
Fork
161
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
12

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của weaviate/weaviate-python-client

Tất cả issue của weaviate/weaviate-python-client

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.