Backing store enumeration returns internal tracking tuples instead of stored lists

Đang mở Phù hợp với người mới
#938 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

@pradeep-ramola đang làm issue này rồi.

Từ ngày 1/12/2026.

  • #939 của @pradeep-ramola — đ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
85/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
backend

Hướng nghiên cứu

Đọc phần triển khai InMemoryBackingStore.enumerate_() và tài liệu giao diện BackingStore về quy ước giá trị trả về. Kiểm tra các assertion hiện có được đề cập trong issue đang mong đợi wrapper, sau đó bổ sung kiểm thử cho các mục có giá trị là danh sách và xác minh rằng thao tác liệt kê trả về danh sách đã lưu ở cả hai chế độ giá trị đã thay đổi. Hoàn tất khi các assertion đó và những bài kiểm thử trừu tượng liên quan đều chạy thành công.

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

Mô tả

Environment

  • Python 3.14.5
  • Windows
  • microsoft-kiota-abstractions 1.19.0, current main at ee58dcfcf10fdc65dfde5f598236220aaef4c86d

Describe the bug

InMemoryBackingStore.enumerate_() returns an internal _Collection(items, size) tuple for list-valued entries rather than the list stored through set(). get() returns the original list, so the two read APIs disagree.

The BackingStore interface documents enumeration as returning the stored values, filtered according to return_only_changed_values. Scalars and tuples are already returned as the actual values.

To reproduce

from kiota_abstractions.store import InMemoryBackingStore

store = InMemoryBackingStore()
store.is_initialization_completed = True
items = [1, 2]
store.set("items", items)
for changed_only in (False, True):
    store.return_only_changed_values = changed_only
    print(store.enumerate_())
    print(dict(store.enumerate_())["items"] is items)

Actual in both modes:

[('items', _Collection(items=[1, 2], size=2))]
False

Expected:

[('items', [1, 2])]
True

This also affects empty lists, nested lists, and lists of backed models. A resized list still returns the tracking wrapper after its dirty state is refreshed.

Additional context

A focused fix can return val unconditionally in the final enumeration projection. The existing collection-size refresh and changed-value filtering do not need to change.

I checked existing issues and PRs. This is separate from #901's detached-model subscription lifecycle issue; no subscription behavior is changed. Two existing assertions currently depend on the wrapper and need to be corrected to assert actual list values.

I verified 20 new parameterized cases against unchanged source: 11 fail on list-valued results and nine pass as controls. With the candidate fix, all 307 abstractions tests and 239 JSON serialization tests pass. Strict mypy passes all 48 abstractions source files. No claim of an HTTP serialization failure is made here.

Implementation and tests were prepared with AI assistance and validated locally.

Ngôn ngữ chính
Python
Star
31
Fork
48
Merge trung bình
16 giờ 36 phút
Pull request đã merge (30 ngày)
73

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 microsoft/kiota-python

Tất cả issue của microsoft/kiota-python

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.