Backing store enumeration returns internal tracking tuples instead of stored lists

Offen Anfängerfreundlich
#938 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@pradeep-ramola arbeitet bereits daran.

Seit 01.12.2026.

  • #939 von @pradeep-ramola — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
85/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
backend

Rechercherichtung

Lies die Implementierung von InMemoryBackingStore.enumerate_() und die Dokumentation der BackingStore-Schnittstelle zum Vertrag für Rückgabewerte. Prüfe die im Issue erwähnten bestehenden Assertions, die den Wrapper erwarten, ergänze dann Tests für Listeneinträge und verifiziere, dass die Enumeration die gespeicherte Liste in beiden Modi für geänderte Werte zurückgibt. Abgeschlossen, wenn diese Assertions und die relevanten Tests für Abstraktionen bestehen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Python
Sterne
31
Forks
48
Ø Merge
16 Std. 36 Min.
Gemergte PRs (30 T.)
73

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/kiota-python

Alle Issues in microsoft/kiota-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.