Skip to content

Commit a087e87

Browse files
committed
Fix stream consumption
1 parent 59ab241 commit a087e87

File tree

2 files changed

+519
-443
lines changed

2 files changed

+519
-443
lines changed

src/pipedream/proxy/client.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ async def get(
413413
account_id: str,
414414
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
415415
params: typing.Optional[typing.Dict[str, typing.Any]] = None,
416-
) -> typing.Union[ProxyResponse, typing.Iterator[bytes]]:
416+
) -> typing.Union[ProxyResponse, typing.AsyncIterator[bytes]]:
417417
"""
418418
Parameters
419419
----------
@@ -434,8 +434,8 @@ async def get(
434434
435435
Returns
436436
-------
437-
typing.Union[ProxyResponse, typing.Iterator[bytes]]
438-
ProxyResponse for JSON content, Iterator[bytes] for binary content
437+
typing.Union[ProxyResponse, typing.AsyncIterator[bytes]]
438+
ProxyResponse for JSON content, AsyncIterator[bytes] for binary content
439439
440440
Examples
441441
--------
@@ -456,7 +456,7 @@ async def main() -> None:
456456
url="https://example.com/api/endpoint",
457457
external_user_id="external_user_id",
458458
account_id="account_id",
459-
headers={"Extra-Downstream-Header": "some value"}
459+
headers={"Extra-Downstream-Header": "some value"},
460460
params={"limit": 10},
461461
)
462462
@@ -476,7 +476,8 @@ async def main() -> None:
476476
url_64,
477477
external_user_id=external_user_id,
478478
account_id=account_id,
479-
request_options=request_options)
479+
request_options=request_options,
480+
)
480481
return _response.data
481482

482483
async def post(
@@ -491,7 +492,7 @@ async def post(
491492
typing.Optional[typing.Any],
492493
]] = None,
493494
params: typing.Optional[typing.Dict[str, typing.Any]] = None,
494-
) -> typing.Union[ProxyResponse, typing.Iterator[bytes]]:
495+
) -> typing.Union[ProxyResponse, typing.AsyncIterator[bytes]]:
495496
"""
496497
Parameters
497498
----------
@@ -515,8 +516,8 @@ async def post(
515516
516517
Returns
517518
-------
518-
typing.Union[ProxyResponse, typing.Iterator[bytes]]
519-
ProxyResponse for JSON content, Iterator[bytes] for binary content
519+
typing.Union[ProxyResponse, typing.AsyncIterator[bytes]]
520+
ProxyResponse for JSON content, AsyncIterator[bytes] for binary content
520521
521522
Examples
522523
--------
@@ -574,7 +575,7 @@ async def put(
574575
typing.Optional[typing.Any],
575576
]] = None,
576577
params: typing.Optional[typing.Dict[str, typing.Any]] = None,
577-
) -> typing.Union[ProxyResponse, typing.Iterator[bytes]]:
578+
) -> typing.Union[ProxyResponse, typing.AsyncIterator[bytes]]:
578579
"""
579580
Parameters
580581
----------
@@ -598,8 +599,8 @@ async def put(
598599
599600
Returns
600601
-------
601-
typing.Union[ProxyResponse, typing.Iterator[bytes]]
602-
ProxyResponse for JSON content, Iterator[bytes] for binary content
602+
typing.Union[ProxyResponse, typing.AsyncIterator[bytes]]
603+
ProxyResponse for JSON content, AsyncIterator[bytes] for binary content
603604
604605
Examples
605606
--------
@@ -653,7 +654,7 @@ async def delete(
653654
account_id: str,
654655
headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
655656
params: typing.Optional[typing.Dict[str, typing.Any]] = None,
656-
) -> typing.Union[ProxyResponse, typing.Iterator[bytes]]:
657+
) -> typing.Union[ProxyResponse, typing.AsyncIterator[bytes]]:
657658
"""
658659
Parameters
659660
----------
@@ -674,8 +675,8 @@ async def delete(
674675
675676
Returns
676677
-------
677-
typing.Union[ProxyResponse, typing.Iterator[bytes]]
678-
ProxyResponse for JSON content, Iterator[bytes] for binary content
678+
typing.Union[ProxyResponse, typing.AsyncIterator[bytes]]
679+
ProxyResponse for JSON content, AsyncIterator[bytes] for binary content
679680
680681
Examples
681682
--------
@@ -715,7 +716,8 @@ async def main() -> None:
715716
url_64,
716717
external_user_id=external_user_id,
717718
account_id=account_id,
718-
request_options=request_options)
719+
request_options=request_options,
720+
)
719721
return _response.data
720722

721723
async def patch(
@@ -730,7 +732,7 @@ async def patch(
730732
typing.Optional[typing.Any],
731733
]] = None,
732734
params: typing.Optional[typing.Dict[str, typing.Any]] = None,
733-
) -> typing.Union[ProxyResponse, typing.Iterator[bytes]]:
735+
) -> typing.Union[ProxyResponse, typing.AsyncIterator[bytes]]:
734736
"""
735737
Parameters
736738
----------
@@ -754,8 +756,8 @@ async def patch(
754756
755757
Returns
756758
-------
757-
typing.Union[ProxyResponse, typing.Iterator[bytes]]
758-
ProxyResponse for JSON content, Iterator[bytes] for binary content
759+
typing.Union[ProxyResponse, typing.AsyncIterator[bytes]]
760+
ProxyResponse for JSON content, AsyncIterator[bytes] for binary content
759761
760762
Examples
761763
--------

0 commit comments

Comments
 (0)