Closed tekumara closed 1 year ago
Hello!
Good idea, resources should support AsyncContextManager
interface.
Sorry for a late response.
THis is not directly related to aiobotocore
, because you are using Table
from aioboto3
. So, try to provide aioboto3
type annotations:
from aioboto3.dynamodb.table import CustomTableResource
async def write(table: CustomTableResource) -> None:
async with table.batch_writer() as batch:
reveal_type(batch)
Hi 👋
If I use CustomTableResource
for table
then elsewhere I can no longer use await self.table.get_item(Key=key)
without getting:
error: Cannot access member "get_item" for type "CustomTableResource"
Member "get_item" is unknown (reportGeneralTypeIssues)
Describe your idea
Support use of TableWriter in an
async with
block.Code sample
Currently fails in pyright with:
Additional context