diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index dd88596f..d095ff6f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,5 @@ # Frequenz Dispatch Client Library Release Notes -## New Features +## Bug Fixes -* Update BaseApiClient to get the http2 keepalive feature. -* Some Methods from the high-level API have been moved to this repo: The dispatch class now offers: `until`, `started`, `next_run` and `next_run_after`. -* Add `start_immediately` support to the `create` method. You can now specify "NOW" as the start time to trigger immediate dispatch. Note: While the dispatch CLI previously allowed this by converting "NOW" to a timestamp client-side before sending it to the server, this functionality is now supported directly on the server side! +* The client was broken due to wrong usage of the new BaseClient API. diff --git a/src/frequenz/client/dispatch/_client.py b/src/frequenz/client/dispatch/_client.py index a3e2e716..36b2a416 100644 --- a/src/frequenz/client/dispatch/_client.py +++ b/src/frequenz/client/dispatch/_client.py @@ -93,10 +93,11 @@ def __init__( self._setup_stub() def _setup_stub(self) -> None: - self._stub = cast( - dispatch_pb2_grpc.MicrogridDispatchServiceAsyncStub, - dispatch_pb2_grpc.MicrogridDispatchServiceStub(self.channel), - ) + stub = dispatch_pb2_grpc.MicrogridDispatchServiceStub(self.channel) + # We need the type: ignore here because the generated async stub only lives in + # the .pyi file (the interpreter doesn't know anything about it) so we can't use + # a proper `cast()`, we can only use the async stub as a type hint. + self._stub: dispatch_pb2_grpc.MicrogridDispatchServiceAsyncStub = stub # type: ignore @property def stub(self) -> dispatch_pb2_grpc.MicrogridDispatchServiceAsyncStub: