Skip to content

Commit 4479570

Browse files
Merge branch 'main' into total_partitions
2 parents 84d8030 + fd0f49a commit 4479570

1 file changed

Lines changed: 1 addition & 42 deletions

File tree

  • packages/pynumaflow/tests/source

packages/pynumaflow/tests/source/utils.py

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from collections.abc import Iterable
2-
31
from pynumaflow.shared.asynciter import NonBlockingIterator
42
from pynumaflow.sourcer import ReadRequest, Message, UserMetadata
53
from pynumaflow.sourcer import (
@@ -89,29 +87,7 @@ async def active_partitions_handler(self) -> PartitionsResponse:
8987
async def total_partitions_handler(self) -> int | None:
9088
return 10
9189

92-
93-
class SyncSource(Sourcer):
94-
def read_handler(self, datum: ReadRequest) -> Iterable[Message]:
95-
payload = b"payload:test_mock_message"
96-
keys = ["test_key"]
97-
offset = mock_offset()
98-
event_time = mock_event_time()
99-
for i in range(10):
100-
yield Message(payload=payload, keys=keys, offset=offset, event_time=event_time)
101-
102-
def ack_handler(self, ack_request: AckRequest):
103-
return
104-
105-
def nack_handler(self, nack_request: NackRequest):
106-
return
107-
108-
def pending_handler(self) -> PendingResponse:
109-
return PendingResponse(count=10)
110-
111-
def active_partitions_handler(self) -> PartitionsResponse:
112-
return PartitionsResponse(partitions=mock_partitions())
113-
114-
90+
11591
def read_req_source_fn() -> ReadRequest:
11692
request = source_pb2.ReadRequest.Request(
11793
num_records=10,
@@ -162,20 +138,3 @@ async def pending_handler(self) -> PendingResponse:
162138

163139
async def active_partitions_handler(self) -> PartitionsResponse:
164140
raise RuntimeError("Got a runtime error from partition handler.")
165-
166-
167-
class SyncSourceError(Sourcer):
168-
def read_handler(self, datum: ReadRequest) -> Iterable[Message]:
169-
raise RuntimeError("Got a runtime error from read handler.")
170-
171-
def ack_handler(self, ack_request: AckRequest):
172-
raise RuntimeError("Got a runtime error from ack handler.")
173-
174-
def nack_handler(self, nack_request: NackRequest):
175-
raise RuntimeError("Got a runtime error from nack handler.")
176-
177-
def pending_handler(self) -> PendingResponse:
178-
raise RuntimeError("Got a runtime error from pending handler.")
179-
180-
def active_partitions_handler(self) -> PartitionsResponse:
181-
raise RuntimeError("Got a runtime error from partition handler.")

0 commit comments

Comments
 (0)