fix: honor Kiota request extensions in Graph transport - #1129
Open
RKS (rksharma-owg) wants to merge 1 commit into
Open
RKS (rksharma-owg) wants to merge 1 commit into
RKS (rksharma-owg) wants to merge 1 commit into
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Overview
Restore Graph middleware execution for requests built by
microsoft-kiota-http1.13.0. Graph-core 1.5.1 only enters its middleware pipeline when an HTTPX request has the legacy.optionsattribute. Kiota commitd9180bbmoved per-request options torequest.extensions["kiota_request_options"], so the Graph transport bypasses redirect, URL replacement, retry, and telemetry middleware. For an empty 302 response from DriveItem/content, this makes the binary request returnNoneinstead of following the download URL.Accept the extension-based options while retaining support for the legacy attribute used by earlier Kiota releases. Graph request context now receives the extension options when present. No public API or generated SDK changes are needed.
Fixes #1128. Related: microsoft/kiota-python#745 and microsoft/kiota-python#744.
Notes
A credential-free HTTPX transport reproduction returned
Noneafter one 302 with Kiota HTTP 1.13.0, but followed the redirect and returned bytes with 1.12.3. The new integration test failed on the unmodified Graph-core transport and passes with this change. It covers two binary content types, legacy option compatibility, extension precedence, and requests without options.The full-tree
isort --check-only srcreports an unchanged import-order issue inbatch_request_item.py; the repository's actual CI command,isort src, succeeds and only reorders that existing file in an isolated checkout. No unrelated formatting is included here.Testing Instructions
pytestafter installingrequirements-dev.txt: 78 passed locally with its pinned Kiota HTTP 1.11.6.pytest: 78 passed locally on Python 3.12.yapf -dr src,mypy src, andpylint src --disable=W --rcfile=.pylintrc: passed locally. Changed-fileisort --check-onlyand sdist/wheel build also passed.b8d5927c651c5e049a132021e72f8d01c83d5021against upstream baseec79992519f708a014676584d5626ea8d733fe2c: Python 3.10–3.14 × Kiota HTTP 1.11.6/1.13.0 (10 jobs, 78 tests each), format, changed-file import order, mypy, pylint, and CodeQL passed: https://github.com/rksharma-owg/msgraph-sdk-python-core/actions/runs/35680942215.