feat: Update Sourcer interface for propagating totalPartitions#343
feat: Update Sourcer interface for propagating totalPartitions#343
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #343 +/- ##
=======================================
Coverage 92.67% 92.68%
=======================================
Files 67 67
Lines 3509 3513 +4
Branches 229 229
=======================================
+ Hits 3252 3256 +4
Misses 193 193
Partials 64 64 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| from pynumaflow.proto.accumulator import accumulator_pb2 as pynumaflow_dot_proto_dot_accumulator_dot_accumulator__pb2 | ||
|
|
||
| GRPC_GENERATED_VERSION = '1.75.0' | ||
| GRPC_GENERATED_VERSION = '1.78.0' |
There was a problem hiding this comment.
Seems like when I installed dependencies using the newly added uv manager, it downloaded the latest version of grpcio-tools:
uv.lock
_________
...
[[package]]
name = "grpcio-tools"
version = "1.78.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "grpcio" },
{ name = "protobuf" },
{ name = "setuptools" },
]
I'm guessing since the dependencies allow versions >= lowest supported version:
pyproject.toml
_______________
...
dependencies = [
"grpcio>=1.48.1",
"grpcio-tools>=1.48.1",
...
Let me force the usage of v1.75.0 grpcio and generate again.
There was a problem hiding this comment.
Wait, but I see the uv.lock already updated with the 1.78.0 version for grpcio-tools. Maybe we never regenerated proto after moving package managers? The PR for migrating from poetry to uv shows version 1.78.0
There was a problem hiding this comment.
Ya, the previous poetry.lock in the PR shows v1.75.0
There was a problem hiding this comment.
let's do in it 2 PRs if you want to update gRPC?
There was a problem hiding this comment.
Ok, let me use the previous grpc version
There was a problem hiding this comment.
Reverted the grpcio version to 1.75.0
PR is much cleaner now. Ty!
|
@vaibhavtiwari33 just a drop in note to update the examples with the updated signatures as well! Thanks |
| if total_partitions is not None: | ||
| result.total_partitions = total_partitions |
There was a problem hiding this comment.
do we really need that check? doesn't python default to None and None is the right value?
There was a problem hiding this comment.
you're right, the proto initializer for PartitionsResponse accepts _Optional[int]
def __init__(self, partitions: _Optional[_Iterable[int]] = ..., total_partitions: _Optional[int] = ...) -> None: ...
I can remove the check. Let me do that.
…for active_partitions_handler and total_partitions, * Maintain backward compatibility Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
…his version Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
…ss in sourcer/_dtypes Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
…handler Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Co-authored-by: Vigith Maurice <vigith@gmail.com> Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
2dd02dc to
84d8030
Compare
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Signed-off-by: Vaibhav Tiwari <vaibhav.tiwari33@gmail.com>
Sourcer changes:
DeprecateRemovepartitions_handlerinSourcerpartitions_handlerwithactive_partitions_handlerinSourcerMaintain backward compatibilityTo maintain backward compatibility (in terms of code compilation on SDK version upgrade), I had made all the following
Sourcermethods optional:partitions_handleractive_partitions_handlertotal_partitions_handlerBut since the
partitions_handlermethod was previously an@abstractmethod, I didn't like the fact that we were removing the constraint of implementing either of the.*partitions_handlermethods.Closes #334