Skip to content

Commit 9ff1356

Browse files
feat: Sourcer changes: * deprecate partitions_handler, * Add support for active_partitions_handler and total_partitions, * Maintain backward compatibility
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
1 parent f894c01 commit 9ff1356

15 files changed

Lines changed: 171 additions & 41 deletions

File tree

packages/pynumaflow/pynumaflow/proto/accumulator/accumulator_pb2_grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
77
from pynumaflow.proto.accumulator import accumulator_pb2 as pynumaflow_dot_proto_dot_accumulator_dot_accumulator__pb2
88

9-
GRPC_GENERATED_VERSION = '1.75.0'
9+
GRPC_GENERATED_VERSION = '1.78.0'
1010
GRPC_VERSION = grpc.__version__
1111
_version_not_supported = False
1212

@@ -19,7 +19,7 @@
1919
if _version_not_supported:
2020
raise RuntimeError(
2121
f'The grpc package installed is at version {GRPC_VERSION},'
22-
+ f' but the generated code in pynumaflow/proto/accumulator/accumulator_pb2_grpc.py depends on'
22+
+ ' but the generated code in pynumaflow/proto/accumulator/accumulator_pb2_grpc.py depends on'
2323
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2424
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2525
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'

packages/pynumaflow/pynumaflow/proto/common/metadata_pb2_grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import warnings
55

66

7-
GRPC_GENERATED_VERSION = '1.75.0'
7+
GRPC_GENERATED_VERSION = '1.78.0'
88
GRPC_VERSION = grpc.__version__
99
_version_not_supported = False
1010

@@ -17,7 +17,7 @@
1717
if _version_not_supported:
1818
raise RuntimeError(
1919
f'The grpc package installed is at version {GRPC_VERSION},'
20-
+ f' but the generated code in pynumaflow/proto/common/metadata_pb2_grpc.py depends on'
20+
+ ' but the generated code in pynumaflow/proto/common/metadata_pb2_grpc.py depends on'
2121
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2222
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2323
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'

packages/pynumaflow/pynumaflow/proto/mapper/map_pb2_grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
77
from pynumaflow.proto.mapper import map_pb2 as pynumaflow_dot_proto_dot_mapper_dot_map__pb2
88

9-
GRPC_GENERATED_VERSION = '1.75.0'
9+
GRPC_GENERATED_VERSION = '1.78.0'
1010
GRPC_VERSION = grpc.__version__
1111
_version_not_supported = False
1212

@@ -19,7 +19,7 @@
1919
if _version_not_supported:
2020
raise RuntimeError(
2121
f'The grpc package installed is at version {GRPC_VERSION},'
22-
+ f' but the generated code in pynumaflow/proto/mapper/map_pb2_grpc.py depends on'
22+
+ ' but the generated code in pynumaflow/proto/mapper/map_pb2_grpc.py depends on'
2323
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2424
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2525
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'

packages/pynumaflow/pynumaflow/proto/reducer/reduce_pb2_grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
77
from pynumaflow.proto.reducer import reduce_pb2 as pynumaflow_dot_proto_dot_reducer_dot_reduce__pb2
88

9-
GRPC_GENERATED_VERSION = '1.75.0'
9+
GRPC_GENERATED_VERSION = '1.78.0'
1010
GRPC_VERSION = grpc.__version__
1111
_version_not_supported = False
1212

@@ -19,7 +19,7 @@
1919
if _version_not_supported:
2020
raise RuntimeError(
2121
f'The grpc package installed is at version {GRPC_VERSION},'
22-
+ f' but the generated code in pynumaflow/proto/reducer/reduce_pb2_grpc.py depends on'
22+
+ ' but the generated code in pynumaflow/proto/reducer/reduce_pb2_grpc.py depends on'
2323
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2424
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2525
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'

packages/pynumaflow/pynumaflow/proto/sideinput/sideinput_pb2_grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
77
from pynumaflow.proto.sideinput import sideinput_pb2 as pynumaflow_dot_proto_dot_sideinput_dot_sideinput__pb2
88

9-
GRPC_GENERATED_VERSION = '1.75.0'
9+
GRPC_GENERATED_VERSION = '1.78.0'
1010
GRPC_VERSION = grpc.__version__
1111
_version_not_supported = False
1212

@@ -19,7 +19,7 @@
1919
if _version_not_supported:
2020
raise RuntimeError(
2121
f'The grpc package installed is at version {GRPC_VERSION},'
22-
+ f' but the generated code in pynumaflow/proto/sideinput/sideinput_pb2_grpc.py depends on'
22+
+ ' but the generated code in pynumaflow/proto/sideinput/sideinput_pb2_grpc.py depends on'
2323
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2424
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2525
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'

packages/pynumaflow/pynumaflow/proto/sinker/sink_pb2_grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
77
from pynumaflow.proto.sinker import sink_pb2 as pynumaflow_dot_proto_dot_sinker_dot_sink__pb2
88

9-
GRPC_GENERATED_VERSION = '1.75.0'
9+
GRPC_GENERATED_VERSION = '1.78.0'
1010
GRPC_VERSION = grpc.__version__
1111
_version_not_supported = False
1212

@@ -19,7 +19,7 @@
1919
if _version_not_supported:
2020
raise RuntimeError(
2121
f'The grpc package installed is at version {GRPC_VERSION},'
22-
+ f' but the generated code in pynumaflow/proto/sinker/sink_pb2_grpc.py depends on'
22+
+ ' but the generated code in pynumaflow/proto/sinker/sink_pb2_grpc.py depends on'
2323
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2424
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2525
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'

packages/pynumaflow/pynumaflow/proto/sourcer/source.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,10 @@ message PendingResponse {
190190
*/
191191
message PartitionsResponse {
192192
message Result {
193-
// Required field holding the list of partitions.
193+
// Required field holding the list of active partitions.
194194
repeated int32 partitions = 1;
195+
// Total number of partitions in the source.
196+
optional int32 total_partitions = 2;
195197
}
196198
// Required field holding the result.
197199
Result result = 1;

packages/pynumaflow/pynumaflow/proto/sourcer/source_pb2.py

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

packages/pynumaflow/pynumaflow/proto/sourcer/source_pb2.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,12 @@ class PendingResponse(_message.Message):
156156
class PartitionsResponse(_message.Message):
157157
__slots__ = ("result",)
158158
class Result(_message.Message):
159-
__slots__ = ("partitions",)
159+
__slots__ = ("partitions", "total_partitions")
160160
PARTITIONS_FIELD_NUMBER: _ClassVar[int]
161+
TOTAL_PARTITIONS_FIELD_NUMBER: _ClassVar[int]
161162
partitions: _containers.RepeatedScalarFieldContainer[int]
162-
def __init__(self, partitions: _Optional[_Iterable[int]] = ...) -> None: ...
163+
total_partitions: int
164+
def __init__(self, partitions: _Optional[_Iterable[int]] = ..., total_partitions: _Optional[int] = ...) -> None: ...
163165
RESULT_FIELD_NUMBER: _ClassVar[int]
164166
result: PartitionsResponse.Result
165167
def __init__(self, result: _Optional[_Union[PartitionsResponse.Result, _Mapping]] = ...) -> None: ...

packages/pynumaflow/pynumaflow/proto/sourcer/source_pb2_grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
77
from pynumaflow.proto.sourcer import source_pb2 as pynumaflow_dot_proto_dot_sourcer_dot_source__pb2
88

9-
GRPC_GENERATED_VERSION = '1.75.0'
9+
GRPC_GENERATED_VERSION = '1.78.0'
1010
GRPC_VERSION = grpc.__version__
1111
_version_not_supported = False
1212

@@ -19,7 +19,7 @@
1919
if _version_not_supported:
2020
raise RuntimeError(
2121
f'The grpc package installed is at version {GRPC_VERSION},'
22-
+ f' but the generated code in pynumaflow/proto/sourcer/source_pb2_grpc.py depends on'
22+
+ ' but the generated code in pynumaflow/proto/sourcer/source_pb2_grpc.py depends on'
2323
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2424
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2525
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'

0 commit comments

Comments
 (0)