|
21 | 21 | Stream,
|
22 | 22 | TransformExpandedCallback,
|
23 | 23 | TransformFunction,
|
24 |
| - TransformWallClockExpandedCallback, |
25 | 24 | )
|
26 | 25 | from quixstreams.core.stream.exceptions import InvalidOperation
|
27 | 26 | from quixstreams.models.topics.manager import TopicManager
|
|
47 | 46 | Iterable[Message],
|
48 | 47 | ]
|
49 | 48 |
|
50 |
| -WallClockCallback = Callable[[int, WindowedPartitionTransaction], Iterable[Message]] |
| 49 | +WallClockCallback = Callable[[WindowedPartitionTransaction], Iterable[Message]] |
51 | 50 |
|
52 | 51 |
|
53 | 52 | class Window(abc.ABC):
|
@@ -79,7 +78,6 @@ def process_window(
|
79 | 78 | @abstractmethod
|
80 | 79 | def process_wall_clock(
|
81 | 80 | self,
|
82 |
| - timestamp_ms: int, |
83 | 81 | transaction: WindowedPartitionTransaction,
|
84 | 82 | ) -> Iterable[WindowKeyResult]:
|
85 | 83 | pass
|
@@ -122,7 +120,7 @@ def _apply_window(
|
122 | 120 | func=windowed_func, expand=True
|
123 | 121 | )
|
124 | 122 | wall_clock_stream = Stream(
|
125 |
| - TransformFunction(wall_clock_transform_func, expand=True, wall_clock=True) |
| 123 | + func=TransformFunction(wall_clock_transform_func, expand=True) |
126 | 124 | )
|
127 | 125 | sdf = self._dataframe.__dataframe_clone__(stream=windowed_stream)
|
128 | 126 | return sdf.concat_wall_clock(wall_clock_stream)
|
@@ -169,10 +167,10 @@ def window_callback(
|
169 | 167 | yield (window, key, window["start"], None)
|
170 | 168 |
|
171 | 169 | def wall_clock_callback(
|
172 |
| - timestamp: int, transaction: WindowedPartitionTransaction |
| 170 | + transaction: WindowedPartitionTransaction, |
173 | 171 | ) -> Iterable[Message]:
|
174 | 172 | # TODO: Check if this will work for sliding windows
|
175 |
| - for key, window in self.process_wall_clock(timestamp, transaction): |
| 173 | + for key, window in self.process_wall_clock(transaction): |
176 | 174 | yield (window, key, window["start"], None)
|
177 | 175 |
|
178 | 176 | return self._apply_window(
|
@@ -225,7 +223,7 @@ def window_callback(
|
225 | 223 | yield (window, key, window["start"], None)
|
226 | 224 |
|
227 | 225 | def wall_clock_callback(
|
228 |
| - timestamp: int, transaction: WindowedPartitionTransaction |
| 226 | + transaction: WindowedPartitionTransaction, |
229 | 227 | ) -> Iterable[Message]:
|
230 | 228 | # TODO: Implement wall_clock callback
|
231 | 229 | return []
|
@@ -475,17 +473,19 @@ def _as_wall_clock(
|
475 | 473 | processing_context: "ProcessingContext",
|
476 | 474 | store_name: str,
|
477 | 475 | stream_id: str,
|
478 |
| -) -> TransformWallClockExpandedCallback: |
| 476 | +) -> TransformExpandedCallback: |
479 | 477 | @functools.wraps(func)
|
480 |
| - def wrapper(timestamp: int) -> Iterable[Message]: |
| 478 | + def wrapper( |
| 479 | + value: Any, key: Any, timestamp: int, headers: Any |
| 480 | + ) -> Iterable[Message]: |
481 | 481 | ctx = message_context()
|
482 | 482 | transaction = cast(
|
483 | 483 | WindowedPartitionTransaction,
|
484 | 484 | processing_context.checkpoint.get_store_transaction(
|
485 | 485 | stream_id=stream_id, partition=ctx.partition, store_name=store_name
|
486 | 486 | ),
|
487 | 487 | )
|
488 |
| - return func(timestamp, transaction) |
| 488 | + return func(transaction) |
489 | 489 |
|
490 | 490 | return wrapper
|
491 | 491 |
|
|
0 commit comments