@@ -29,7 +29,7 @@ class WindowOperation(IntEnum):
2929 APPEND = (4 ,)
3030
3131
32- @dataclass (init = False )
32+ @dataclass (init = False , slots = True )
3333class Message :
3434 """
3535 Basic datatype for data passing to the next vertex/vertices.
@@ -40,8 +40,6 @@ class Message:
4040 tags: []string tags for conditional forwarding (optional)
4141 """
4242
43- __slots__ = ("_value" , "_keys" , "_tags" )
44-
4543 _value : bytes
4644 _keys : list [str ]
4745 _tags : list [str ]
@@ -115,7 +113,7 @@ def items(self) -> list[Message]:
115113 return self ._messages
116114
117115
118- @dataclass (init = False )
116+ @dataclass (init = False , slots = True )
119117class Datum :
120118 """
121119 Class to define the important information for the event.
@@ -142,8 +140,6 @@ class Datum:
142140 ```
143141 """
144142
145- __slots__ = ("_keys" , "_value" , "_event_time" , "_watermark" , "_headers" )
146-
147143 _keys : list [str ]
148144 _value : bytes
149145 _event_time : datetime
@@ -194,12 +190,10 @@ def headers(self) -> dict[str, str]:
194190 return self ._headers .copy ()
195191
196192
197- @dataclass (init = False )
193+ @dataclass (init = False , slots = True )
198194class IntervalWindow :
199195 """Defines the start and end of the interval window for the event."""
200196
201- __slots__ = ("_start" , "_end" )
202-
203197 _start : datetime
204198 _end : datetime
205199
@@ -218,15 +212,13 @@ def end(self):
218212 return self ._end
219213
220214
221- @dataclass (init = False )
215+ @dataclass (init = False , slots = True )
222216class ReduceWindow :
223217 """
224218 Defines the window for a reduce operation which includes the
225219 interval window along with the slot.
226220 """
227221
228- __slots__ = ("_window" , "_slot" )
229-
230222 _window : IntervalWindow
231223 _slot : str
232224
@@ -255,12 +247,10 @@ def window(self):
255247 return self ._window
256248
257249
258- @dataclass (init = False )
250+ @dataclass (init = False , slots = True )
259251class Metadata :
260252 """Defines the metadata for the event."""
261253
262- __slots__ = ("_interval_window" ,)
263-
264254 _interval_window : IntervalWindow
265255
266256 def __init__ (self , interval_window : IntervalWindow ):
0 commit comments