Skip to content

Instantly share code, notes, and snippets.

@joshdemir
joshdemir / async_query.py
Created December 24, 2020 15:06
Asynchronous Azure Table PointQueries in Python
import asyncio
from azure.data.tables import TableClient
client = TableClient.from_connection_string(conn_str='foo', table_name='bar')
async def run_query(partition_key, row_key):
return client.query_entity(partition_key, row_key)
async def gather_queries(partition_key, row_key_base, substitutions):
return asyncio.gather(*[run_query(partition_key, row_key % subst) for subst in substitutions])