Skip to content

Commit 7d031ed

Browse files
authored
Fix base-client used wrongly (frequenz-floss#108)
2 parents eb35d0d + f4c0679 commit 7d031ed

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Frequenz Dispatch Client Library Release Notes
22

3-
## New Features
3+
## Bug Fixes
44

5-
* Update BaseApiClient to get the http2 keepalive feature.
6-
* 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`.
7-
* 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!
5+
* The client was broken due to wrong usage of the new BaseClient API.

src/frequenz/client/dispatch/_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,11 @@ def __init__(
9393
self._setup_stub()
9494

9595
def _setup_stub(self) -> None:
96-
self._stub = cast(
97-
dispatch_pb2_grpc.MicrogridDispatchServiceAsyncStub,
98-
dispatch_pb2_grpc.MicrogridDispatchServiceStub(self.channel),
99-
)
96+
stub = dispatch_pb2_grpc.MicrogridDispatchServiceStub(self.channel)
97+
# We need the type: ignore here because the generated async stub only lives in
98+
# the .pyi file (the interpreter doesn't know anything about it) so we can't use
99+
# a proper `cast()`, we can only use the async stub as a type hint.
100+
self._stub: dispatch_pb2_grpc.MicrogridDispatchServiceAsyncStub = stub # type: ignore
100101

101102
@property
102103
def stub(self) -> dispatch_pb2_grpc.MicrogridDispatchServiceAsyncStub:

0 commit comments

Comments
 (0)