Skip to content

Commit fdf74d9

Browse files
committed
Update base client to v0.8.0
1 parent e6e9235 commit fdf74d9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies = [
3333
"grpcio >= 1.54.2, < 2",
3434
"grpcio-tools >= 1.54.2, < 2",
3535
"protobuf >= 4.25.3, < 6",
36-
"frequenz-client-base >= 0.6.0, < 0.7.0",
36+
"frequenz-client-base >= 0.8.0, < 0.9.0",
3737
]
3838
dynamic = ["version"]
3939

src/frequenz/client/reporting/_client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from frequenz.api.reporting.v1.reporting_pb2 import TimeFilter as PBTimeFilter
2929
from frequenz.api.reporting.v1.reporting_pb2_grpc import ReportingStub
3030
from frequenz.client.base.client import BaseApiClient
31+
from frequenz.client.base.exception import ClientNotConnected
3132
from frequenz.client.common.metric import Metric
3233
from google.protobuf.timestamp_pb2 import Timestamp as PBTimestamp
3334

@@ -151,6 +152,13 @@ def __init__(self, server_url: str, key: str | None = None) -> None:
151152

152153
self._metadata = (("key", key),) if key else ()
153154

155+
@property
156+
def stub(self) -> ReportingStub:
157+
"""The gRPC stub for the API."""
158+
if self.channel is None or self._stub is None:
159+
raise ClientNotConnected(server_url=self.server_url, operation="stub")
160+
return self._stub
161+
154162
# pylint: disable=too-many-arguments
155163
async def list_single_component_data(
156164
self,

0 commit comments

Comments
 (0)