11import asyncio
2- from collections .abc import AsyncIterable
2+ from collections .abc import AsyncIterator
33
44from google .protobuf import timestamp_pb2 as _timestamp_pb2
55from google .protobuf import empty_pb2 as _empty_pb2
@@ -80,9 +80,9 @@ def __initialize_handlers(self):
8080
8181 async def ReadFn (
8282 self ,
83- request_iterator : AsyncIterable [source_pb2 .ReadRequest ],
83+ request_iterator : AsyncIterator [source_pb2 .ReadRequest ],
8484 context : NumaflowServicerContext ,
85- ) -> AsyncIterable [source_pb2 .ReadResponse ]:
85+ ) -> AsyncIterator [source_pb2 .ReadResponse ]:
8686 """
8787 Handles the Read function, processing incoming requests and sending responses.
8888 """
@@ -108,7 +108,7 @@ async def ReadFn(
108108
109109 async for resp in riter :
110110 if isinstance (resp , BaseException ):
111- await handle_async_error (context , resp )
111+ await handle_async_error (context , resp , ERR_UDF_EXCEPTION_STRING )
112112 return
113113
114114 yield _create_read_response (resp )
@@ -139,9 +139,9 @@ async def __invoke_read(self, req, niter):
139139
140140 async def AckFn (
141141 self ,
142- request_iterator : AsyncIterable [source_pb2 .AckRequest ],
142+ request_iterator : AsyncIterator [source_pb2 .AckRequest ],
143143 context : NumaflowServicerContext ,
144- ) -> AsyncIterable [source_pb2 .AckResponse ]:
144+ ) -> AsyncIterator [source_pb2 .AckResponse ]:
145145 """
146146 Handles the Ack function for user-defined source.
147147 """
0 commit comments