Backing store enumeration returns internal tracking tuples instead of stored lists

Aperta Adatta ai principianti
#938 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@pradeep-ramola ci sta già lavorando.

Dal 1/12/2026.

  • #939 di @pradeep-ramola — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
85/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Leggi l’implementazione di InMemoryBackingStore.enumerate_() e la documentazione dell’interfaccia BackingStore sul contratto del valore restituito. Controlla le asserzioni esistenti menzionate nell’issue che si aspettano il wrapper, quindi aggiungi test per le voci con valore di tipo lista e verifica che l’enumerazione restituisca la lista memorizzata in entrambe le modalità per i valori modificati. Il lavoro è completato quando queste asserzioni e i test pertinenti delle astrazioni passano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
31
Fork
48
Merge medio
16h 36m
PR unite (30g)
73

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/kiota-python

Tutte le issue di microsoft/kiota-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.