Skip to content

Commit fd0f49a

Browse files
chore: remove unused SyncSource classes (#345)
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
1 parent 4566a8e commit fd0f49a

File tree

1 file changed

+0
-41
lines changed
  • packages/pynumaflow/tests/source

1 file changed

+0
-41
lines changed

packages/pynumaflow/tests/source/utils.py

Lines changed: 0 additions & 41 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 (
@@ -56,28 +54,6 @@ async def partitions_handler(self) -> PartitionsResponse:
5654
return PartitionsResponse(partitions=mock_partitions())
5755

5856

59-
class SyncSource(Sourcer):
60-
def read_handler(self, datum: ReadRequest) -> Iterable[Message]:
61-
payload = b"payload:test_mock_message"
62-
keys = ["test_key"]
63-
offset = mock_offset()
64-
event_time = mock_event_time()
65-
for i in range(10):
66-
yield Message(payload=payload, keys=keys, offset=offset, event_time=event_time)
67-
68-
def ack_handler(self, ack_request: AckRequest):
69-
return
70-
71-
def nack_handler(self, nack_request: NackRequest):
72-
return
73-
74-
def pending_handler(self) -> PendingResponse:
75-
return PendingResponse(count=10)
76-
77-
def partitions_handler(self) -> PartitionsResponse:
78-
return PartitionsResponse(partitions=mock_partitions())
79-
80-
8157
def read_req_source_fn() -> ReadRequest:
8258
request = source_pb2.ReadRequest.Request(
8359
num_records=10,
@@ -128,20 +104,3 @@ async def pending_handler(self) -> PendingResponse:
128104

129105
async def partitions_handler(self) -> PartitionsResponse:
130106
raise RuntimeError("Got a runtime error from partition handler.")
131-
132-
133-
class SyncSourceError(Sourcer):
134-
def read_handler(self, datum: ReadRequest) -> Iterable[Message]:
135-
raise RuntimeError("Got a runtime error from read handler.")
136-
137-
def ack_handler(self, ack_request: AckRequest):
138-
raise RuntimeError("Got a runtime error from ack handler.")
139-
140-
def nack_handler(self, nack_request: NackRequest):
141-
raise RuntimeError("Got a runtime error from nack handler.")
142-
143-
def pending_handler(self) -> PendingResponse:
144-
raise RuntimeError("Got a runtime error from pending handler.")
145-
146-
def partitions_handler(self) -> PartitionsResponse:
147-
raise RuntimeError("Got a runtime error from partition handler.")

0 commit comments

Comments
 (0)