Skip to content

Commit e1a7c9a

Browse files
srao12srao12
authored andcommitted
fix: lint
Signed-off-by: srao12 <Shrivardhan_Rao@intuit.com>
1 parent 53ec8da commit e1a7c9a

20 files changed

Lines changed: 1099 additions & 651 deletions

pynumaflow/proto/accumulator/accumulator_pb2.py

Lines changed: 29 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pynumaflow/proto/accumulator/accumulator_pb2.pyi

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@ from google.protobuf.internal import containers as _containers
44
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
55
from google.protobuf import descriptor as _descriptor
66
from google.protobuf import message as _message
7-
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
7+
from typing import (
8+
ClassVar as _ClassVar,
9+
Iterable as _Iterable,
10+
Mapping as _Mapping,
11+
Optional as _Optional,
12+
Union as _Union,
13+
)
814

915
DESCRIPTOR: _descriptor.FileDescriptor
1016

1117
class Payload(_message.Message):
1218
__slots__ = ("keys", "value", "event_time", "watermark", "id", "headers")
19+
1320
class HeadersEntry(_message.Message):
1421
__slots__ = ("key", "value")
1522
KEY_FIELD_NUMBER: _ClassVar[int]
@@ -29,12 +36,22 @@ class Payload(_message.Message):
2936
watermark: _timestamp_pb2.Timestamp
3037
id: str
3138
headers: _containers.ScalarMap[str, str]
32-
def __init__(self, keys: _Optional[_Iterable[str]] = ..., value: _Optional[bytes] = ..., event_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., watermark: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., id: _Optional[str] = ..., headers: _Optional[_Mapping[str, str]] = ...) -> None: ...
39+
def __init__(
40+
self,
41+
keys: _Optional[_Iterable[str]] = ...,
42+
value: _Optional[bytes] = ...,
43+
event_time: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
44+
watermark: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
45+
id: _Optional[str] = ...,
46+
headers: _Optional[_Mapping[str, str]] = ...,
47+
) -> None: ...
3348

3449
class AccumulatorRequest(_message.Message):
3550
__slots__ = ("payload", "operation")
51+
3652
class WindowOperation(_message.Message):
3753
__slots__ = ("event", "keyedWindow")
54+
3855
class Event(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
3956
__slots__ = ()
4057
OPEN: _ClassVar[AccumulatorRequest.WindowOperation.Event]
@@ -47,12 +64,20 @@ class AccumulatorRequest(_message.Message):
4764
KEYEDWINDOW_FIELD_NUMBER: _ClassVar[int]
4865
event: AccumulatorRequest.WindowOperation.Event
4966
keyedWindow: KeyedWindow
50-
def __init__(self, event: _Optional[_Union[AccumulatorRequest.WindowOperation.Event, str]] = ..., keyedWindow: _Optional[_Union[KeyedWindow, _Mapping]] = ...) -> None: ...
67+
def __init__(
68+
self,
69+
event: _Optional[_Union[AccumulatorRequest.WindowOperation.Event, str]] = ...,
70+
keyedWindow: _Optional[_Union[KeyedWindow, _Mapping]] = ...,
71+
) -> None: ...
5172
PAYLOAD_FIELD_NUMBER: _ClassVar[int]
5273
OPERATION_FIELD_NUMBER: _ClassVar[int]
5374
payload: Payload
5475
operation: AccumulatorRequest.WindowOperation
55-
def __init__(self, payload: _Optional[_Union[Payload, _Mapping]] = ..., operation: _Optional[_Union[AccumulatorRequest.WindowOperation, _Mapping]] = ...) -> None: ...
76+
def __init__(
77+
self,
78+
payload: _Optional[_Union[Payload, _Mapping]] = ...,
79+
operation: _Optional[_Union[AccumulatorRequest.WindowOperation, _Mapping]] = ...,
80+
) -> None: ...
5681

5782
class KeyedWindow(_message.Message):
5883
__slots__ = ("start", "end", "slot", "keys")
@@ -64,7 +89,13 @@ class KeyedWindow(_message.Message):
6489
end: _timestamp_pb2.Timestamp
6590
slot: str
6691
keys: _containers.RepeatedScalarFieldContainer[str]
67-
def __init__(self, start: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., end: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., slot: _Optional[str] = ..., keys: _Optional[_Iterable[str]] = ...) -> None: ...
92+
def __init__(
93+
self,
94+
start: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
95+
end: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ...,
96+
slot: _Optional[str] = ...,
97+
keys: _Optional[_Iterable[str]] = ...,
98+
) -> None: ...
6899

69100
class AccumulatorResponse(_message.Message):
70101
__slots__ = ("payload", "window", "tags", "EOF")
@@ -76,7 +107,13 @@ class AccumulatorResponse(_message.Message):
76107
window: KeyedWindow
77108
tags: _containers.RepeatedScalarFieldContainer[str]
78109
EOF: bool
79-
def __init__(self, payload: _Optional[_Union[Payload, _Mapping]] = ..., window: _Optional[_Union[KeyedWindow, _Mapping]] = ..., tags: _Optional[_Iterable[str]] = ..., EOF: bool = ...) -> None: ...
110+
def __init__(
111+
self,
112+
payload: _Optional[_Union[Payload, _Mapping]] = ...,
113+
window: _Optional[_Union[KeyedWindow, _Mapping]] = ...,
114+
tags: _Optional[_Iterable[str]] = ...,
115+
EOF: bool = ...,
116+
) -> None: ...
80117

81118
class ReadyResponse(_message.Message):
82119
__slots__ = ("ready",)

pynumaflow/proto/accumulator/accumulator_pb2_grpc.py

Lines changed: 75 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ def __init__(self, channel):
1919
channel: A grpc.Channel.
2020
"""
2121
self.AccumulateFn = channel.stream_stream(
22-
'/accumulator.v1.Accumulator/AccumulateFn',
23-
request_serializer=accumulator__pb2.AccumulatorRequest.SerializeToString,
24-
response_deserializer=accumulator__pb2.AccumulatorResponse.FromString,
25-
)
22+
"/accumulator.v1.Accumulator/AccumulateFn",
23+
request_serializer=accumulator__pb2.AccumulatorRequest.SerializeToString,
24+
response_deserializer=accumulator__pb2.AccumulatorResponse.FromString,
25+
)
2626
self.IsReady = channel.unary_unary(
27-
'/accumulator.v1.Accumulator/IsReady',
28-
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
29-
response_deserializer=accumulator__pb2.ReadyResponse.FromString,
30-
)
27+
"/accumulator.v1.Accumulator/IsReady",
28+
request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
29+
response_deserializer=accumulator__pb2.ReadyResponse.FromString,
30+
)
3131

3232

3333
class AccumulatorServicer(object):
@@ -37,75 +37,98 @@ class AccumulatorServicer(object):
3737
"""
3838

3939
def AccumulateFn(self, request_iterator, context):
40-
"""AccumulateFn applies a accumulate function to a request stream.
41-
"""
40+
"""AccumulateFn applies a accumulate function to a request stream."""
4241
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
43-
context.set_details('Method not implemented!')
44-
raise NotImplementedError('Method not implemented!')
42+
context.set_details("Method not implemented!")
43+
raise NotImplementedError("Method not implemented!")
4544

4645
def IsReady(self, request, context):
47-
"""IsReady is the heartbeat endpoint for gRPC.
48-
"""
46+
"""IsReady is the heartbeat endpoint for gRPC."""
4947
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
50-
context.set_details('Method not implemented!')
51-
raise NotImplementedError('Method not implemented!')
48+
context.set_details("Method not implemented!")
49+
raise NotImplementedError("Method not implemented!")
5250

5351

5452
def add_AccumulatorServicer_to_server(servicer, server):
5553
rpc_method_handlers = {
56-
'AccumulateFn': grpc.stream_stream_rpc_method_handler(
57-
servicer.AccumulateFn,
58-
request_deserializer=accumulator__pb2.AccumulatorRequest.FromString,
59-
response_serializer=accumulator__pb2.AccumulatorResponse.SerializeToString,
60-
),
61-
'IsReady': grpc.unary_unary_rpc_method_handler(
62-
servicer.IsReady,
63-
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
64-
response_serializer=accumulator__pb2.ReadyResponse.SerializeToString,
65-
),
54+
"AccumulateFn": grpc.stream_stream_rpc_method_handler(
55+
servicer.AccumulateFn,
56+
request_deserializer=accumulator__pb2.AccumulatorRequest.FromString,
57+
response_serializer=accumulator__pb2.AccumulatorResponse.SerializeToString,
58+
),
59+
"IsReady": grpc.unary_unary_rpc_method_handler(
60+
servicer.IsReady,
61+
request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
62+
response_serializer=accumulator__pb2.ReadyResponse.SerializeToString,
63+
),
6664
}
6765
generic_handler = grpc.method_handlers_generic_handler(
68-
'accumulator.v1.Accumulator', rpc_method_handlers)
66+
"accumulator.v1.Accumulator", rpc_method_handlers
67+
)
6968
server.add_generic_rpc_handlers((generic_handler,))
7069

7170

72-
# This class is part of an EXPERIMENTAL API.
71+
# This class is part of an EXPERIMENTAL API.
7372
class Accumulator(object):
7473
"""AccumulatorWindow describes a special kind of SessionWindow (similar to Global Window) where output should
7574
always have monotonically increasing WM but it can be manipulated through event-time by reordering the messages.
7675
NOTE: Quite powerful, should not be abused; it can cause stalling of pipelines and leaks
7776
"""
7877

7978
@staticmethod
80-
def AccumulateFn(request_iterator,
79+
def AccumulateFn(
80+
request_iterator,
81+
target,
82+
options=(),
83+
channel_credentials=None,
84+
call_credentials=None,
85+
insecure=False,
86+
compression=None,
87+
wait_for_ready=None,
88+
timeout=None,
89+
metadata=None,
90+
):
91+
return grpc.experimental.stream_stream(
92+
request_iterator,
8193
target,
82-
options=(),
83-
channel_credentials=None,
84-
call_credentials=None,
85-
insecure=False,
86-
compression=None,
87-
wait_for_ready=None,
88-
timeout=None,
89-
metadata=None):
90-
return grpc.experimental.stream_stream(request_iterator, target, '/accumulator.v1.Accumulator/AccumulateFn',
94+
"/accumulator.v1.Accumulator/AccumulateFn",
9195
accumulator__pb2.AccumulatorRequest.SerializeToString,
9296
accumulator__pb2.AccumulatorResponse.FromString,
93-
options, channel_credentials,
94-
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
97+
options,
98+
channel_credentials,
99+
insecure,
100+
call_credentials,
101+
compression,
102+
wait_for_ready,
103+
timeout,
104+
metadata,
105+
)
95106

96107
@staticmethod
97-
def IsReady(request,
108+
def IsReady(
109+
request,
110+
target,
111+
options=(),
112+
channel_credentials=None,
113+
call_credentials=None,
114+
insecure=False,
115+
compression=None,
116+
wait_for_ready=None,
117+
timeout=None,
118+
metadata=None,
119+
):
120+
return grpc.experimental.unary_unary(
121+
request,
98122
target,
99-
options=(),
100-
channel_credentials=None,
101-
call_credentials=None,
102-
insecure=False,
103-
compression=None,
104-
wait_for_ready=None,
105-
timeout=None,
106-
metadata=None):
107-
return grpc.experimental.unary_unary(request, target, '/accumulator.v1.Accumulator/IsReady',
123+
"/accumulator.v1.Accumulator/IsReady",
108124
google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
109125
accumulator__pb2.ReadyResponse.FromString,
110-
options, channel_credentials,
111-
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
126+
options,
127+
channel_credentials,
128+
insecure,
129+
call_credentials,
130+
compression,
131+
wait_for_ready,
132+
timeout,
133+
metadata,
134+
)

0 commit comments

Comments
 (0)