Backing store enumeration returns internal tracking tuples instead of stored lists
維護者通常 1 天內回覆
評估
研究方向
閱讀InMemoryBackingStore.enumerate_()的實作,以及BackingStore介面文件中關於回傳值契約的說明。檢查 issue 中提到的、預期回傳包裝器的既有斷言,接著為列表值項目補上測試,並確認在兩種變更值模式下,列舉都會回傳已儲存的列表。這些斷言和相關抽象測試通過後即算完成。
由索引模型根據 Issue 內容生成。
描述
Environment
- Python 3.14.5
- Windows
microsoft-kiota-abstractions1.19.0, current main atee58dcfcf10fdc65dfde5f598236220aaef4c86d
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.
- 主要語言
- Python
- 星號
- 31
- 分支
- 48
- 平均合併
- 16 小時 36 分鐘
- 30 天內合併 PR
- 73
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/kiota-python 的其他 Issue
-
JSON numeric getters accept booleans as integers and floats可能已有人在做 @pradeep-ramola 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
microsoft/kiota-python#935 ·
維護者通常 1 天內回覆
-
ensure 304 response code does not throw可能重新可做 @nightcityblade 於 92 天前認領,目前沒有進行中的 PR。 未關閉help wanted type:bug
難度 2/5 1-3 小時 新手友好度 68/100
microsoft/kiota-python#477 · 2 則留言 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 48/100
microsoft/kiota-python#901 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 18/100
microsoft/kiota-python#898 ·
維護者通常 1 天內回覆
-
type:breaking-change
難度 5/5 一週以上 新手友好度 12/100
microsoft/kiota-python#777 · 2 則留言 ·
維護者通常 1 天內回覆
查看 microsoft/kiota-python 的全部 Issue
相似的 Issue
-
backend: claude chore dependencies
難度 2/5 1-3 小時 新手友好度 72/100
briandconnelly/amicus#606 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
semantica-agi/semantica#2320 ·
維護者通常 2 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 77/100
vllm-project/vllm-omni#11465 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 62/100
jxxghp/MoviePilot#7699 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
vllm-project/vllm-ascend#24010 ·
維護者通常 1 天內回覆