-
Notifications
You must be signed in to change notification settings - Fork 3.3k
azure-data-tables: async list_entities(query_filter=...) leaks kwarg to aiohttp transport causing TypeError #46014
Description
- Package Name: azure-data-tables
- Package Version: 12.7.0
- Operating System: Linux (Azure Functions) and macOS (local repro)
- Python Version: 3.13.11 (Azure), 3.14.2 (local)
Describe the bug
The async TableClient.list_entities(query_filter=...) leaks the query_filter keyword argument through the pipeline to aiohttp.ClientSession._request(), which rejects it with TypeError: ClientSession._request() got an unexpected keyword argument 'query_filter'.
The kwargs flow through:
azure.data.tables.aio._base_client_async.py:320—return await self._transport.send(request, **kwargs)azure.core.pipeline.transport._aiohttp.py:346—result = await self.session.request(..., **config)aiohttp/client.py—self._request(method, url, **kwargs)raisesTypeError
This affects only the async client (azure.data.tables.aio). The sync client is not affected.
query_entities(filter) works as a workaround because it accepts the filter as a positional argument, so it does not appear in **kwargs.
To Reproduce
import asyncio
from azure.data.tables.aio import TableServiceClient
from azure.identity.aio import DefaultAzureCredential
async def main() -> None:
endpoint = "https://<your-storage-account>.table.core.windows.net"
async with (
DefaultAzureCredential() as cred,
TableServiceClient(endpoint=endpoint, credential=cred) as svc,
):
table = svc.get_table_client("<your-table-name>")
async for entity in table.list_entities(query_filter="PartitionKey eq 'mypartition'"):
print(entity)
break
asyncio.run(main())Error:
TypeError: ClientSession._request() got an unexpected keyword argument 'query_filter'
Expected behavior
list_entities(query_filter=...) should filter server-side and return matching entities, the same as it does with the sync client. The query_filter parameter should be consumed by the SDK and not forwarded to the HTTP transport layer.
Additional context
azure-coreversion: 1.39.0aiohttpversions tested: 3.12.15 and 3.13.4 (both fail)- Workaround: use
table.query_entities("PartitionKey eq 'mypartition'")instead - Stack trace from production (Azure Functions on Python 3.13):
File "azure/data/tables/_generated/aio/operations/_operations.py", line 418, in query_entities
pipeline_response: PipelineResponse = await self._client._pipeline.run(
request, stream=_stream, **kwargs
)
File "azure/core/pipeline/_base_async.py", line 111, in send
await self._sender.send(request.http_request, **request.context.options),
File "azure/data/tables/aio/_base_client_async.py", line 320, in send
return await self._transport.send(request, **kwargs)
File "azure/core/pipeline/transport/_aiohttp.py", line 346, in send
result = await self.session.request(
request.method, ..., **config,
)
File "aiohttp/client.py", line 482, in request
return _RequestContextManager(self._request(method, url, **kwargs))
TypeError: ClientSession._request() got an unexpected keyword argument 'query_filter'