You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
While addressing the azure-data-tables fix in #46137 for #46014, we identified a broader shared transport-layer issue in azure-core. Unsupported SDK-specific kwargs can leak through pipeline context into the built-in transports, where backend HTTP libraries may reject them with low-level TypeErrors.
This surfaced in azure-data-tables async usage, where list_entities(query_filter=...) allowed unsupported kwargs to flow through pipeline.run(..., **kwargs) into AioHttpTransport.send() and ultimately aiohttp.ClientSession.request().
Today, per-call kwargs are accumulated in PipelineContext.options and passed through to transport send(..., **kwargs). The shared cleanup step removes only a small denylist of internal keys, so leftover SDK-specific kwargs can still reach the transport layer.
This creates a class of bugs where:
async transports fail with backend-specific TypeError
sync transports may appear to work or fail differently
individual SDKs end up patching symptoms method by method
TypeError: ClientSession._request() got an unexpected keyword argument 'query_filter'
The tables-specific PR fixes this one API by validating the unsupported kwarg earlier, but the broader leak path remains for any SDK-specific kwarg that survives into transport **kwargs.
Describe the solution you'd like
Investigate a shared fix in built-in transports that:
explicitly consumes the per-call kwargs each transport supports
detects leftover kwargs before forwarding to the underlying HTTP library
raises a clear SDK-level error for unsupported transport kwargs
Transports in scope:
AioHttpTransport
RequestsTransport
AsyncioRequestsTransport
TrioRequestsTransport
Related parity check:
corehttp has a similar pipeline/transport sanitization pattern and may need the same treatment
Describe alternatives you've considered
Expanding cleanup_kwargs_for_transport into a broad allowlist at the pipeline-runner level. Rejected because the runner serves both built-in and custom transports, and a static allowlist there risks silently dropping legitimate kwargs for custom transport implementations.
Fixing the leak in generator templates so operations don't forward **kwargs to pipeline.run(). Reasonable as a longer-term improvement, but it does not address existing hand-written SDKs or the shared transport contract.
Sync compatibility needs care. Some stray kwargs are currently tolerated on sync paths in ways that async paths are not, so a systemic fix may need a warn-then-error transition rather than an immediate hard break.
This issue is not proposing to change service-level API contracts. Individual SDKs should still validate unsupported public kwargs at their own API boundaries where appropriate, as done in #46137 for TableClient.list_entities.
Is your feature request related to a problem? Please describe.
While addressing the
azure-data-tablesfix in #46137 for #46014, we identified a broader shared transport-layer issue inazure-core. Unsupported SDK-specific kwargs can leak through pipeline context into the built-in transports, where backend HTTP libraries may reject them with low-levelTypeErrors.This surfaced in
azure-data-tablesasync usage, wherelist_entities(query_filter=...)allowed unsupported kwargs to flow throughpipeline.run(..., **kwargs)intoAioHttpTransport.send()and ultimatelyaiohttp.ClientSession.request().Today, per-call kwargs are accumulated in
PipelineContext.optionsand passed through to transportsend(..., **kwargs). The shared cleanup step removes only a small denylist of internal keys, so leftover SDK-specific kwargs can still reach the transport layer.This creates a class of bugs where:
TypeErrorCall path
sdk/tables/azure-data-tables/azure/data/tables/_generated/aio/operations/_operations.py:418pipeline.run(request, stream=_stream, **kwargs)sdk/core/azure-core/azure/core/pipeline/_base_async.py:226PipelineContext(self._transport, **kwargs)sdk/core/azure-core/azure/core/pipeline/__init__.py:66PipelineContext.options = kwargssdk/core/azure-core/azure/core/pipeline/_base_async.py:111_AsyncTransportRunner.send()forwards**request.context.optionsto transportsend(...)sdk/core/azure-core/azure/core/pipeline/_base.py:54cleanup_kwargs_for_transportonly strips a few hardcoded keyssdk/core/azure-core/azure/core/pipeline/transport/_aiohttp.py:352session.request(..., **config)forwards leftover kwargs toaiohttpsdk/core/corehttp/corehttp/runtime/pipeline/_tools.py:50corehttphas an equivalent narrow helperMinimal reproducer
Concrete reproducer observed in
azure-data-tables:Observed failure on the async path:
The tables-specific PR fixes this one API by validating the unsupported kwarg earlier, but the broader leak path remains for any SDK-specific kwarg that survives into transport
**kwargs.Describe the solution you'd like
Investigate a shared fix in built-in transports that:
Transports in scope:
AioHttpTransportRequestsTransportAsyncioRequestsTransportTrioRequestsTransportRelated parity check:
corehttphas a similar pipeline/transport sanitization pattern and may need the same treatmentDescribe alternatives you've considered
cleanup_kwargs_for_transportinto a broad allowlist at the pipeline-runner level. Rejected because the runner serves both built-in and custom transports, and a static allowlist there risks silently dropping legitimate kwargs for custom transport implementations.**kwargstopipeline.run(). Reasonable as a longer-term improvement, but it does not address existing hand-written SDKs or the shared transport contract.Additional context
Sync compatibility needs care. Some stray kwargs are currently tolerated on sync paths in ways that async paths are not, so a systemic fix may need a warn-then-error transition rather than an immediate hard break.
This issue is not proposing to change service-level API contracts. Individual SDKs should still validate unsupported public kwargs at their own API boundaries where appropriate, as done in #46137 for
TableClient.list_entities.References