Skip to content

Commit 51bef49

Browse files
authored
Merge pull request #18 from NHSDigital/mm-mesh-1478-publish-wheel-to-release
mesh-1478: async generator type for async stream from s3
2 parents ffc224e + 50f09e9 commit 51bef49

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nhs_aws_helpers/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from typing import (
1313
IO,
1414
Any,
15-
AsyncIterator,
15+
AsyncGenerator,
1616
Callable,
1717
Dict,
1818
Generator,
@@ -1125,7 +1125,9 @@ def assumed_role_session(
11251125
return Session(botocore_session=session)
11261126

11271127

1128-
async def async_stream_from_s3(s3_get_resp: GetObjectOutputTypeDef, bytes_per_chunk: int) -> AsyncIterator[bytes]:
1128+
async def async_stream_from_s3(
1129+
s3_get_resp: GetObjectOutputTypeDef, bytes_per_chunk: int
1130+
) -> AsyncGenerator[bytes, None]:
11291131
body = s3_get_resp["Body"]
11301132
chunk = await run_in_executor(body.read, bytes_per_chunk)
11311133
while chunk:

0 commit comments

Comments
 (0)