Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies = [
"grpcio >= 1.54.2, < 2",
"grpcio-tools >= 1.54.2, < 2",
"protobuf >= 4.25.3, < 6",
"frequenz-client-base >= 0.6.0, < 0.7.0",
"frequenz-client-base >= 0.8.0, < 0.9.0",
]
dynamic = ["version"]

Expand Down
8 changes: 8 additions & 0 deletions src/frequenz/client/reporting/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from frequenz.api.reporting.v1.reporting_pb2 import TimeFilter as PBTimeFilter
from frequenz.api.reporting.v1.reporting_pb2_grpc import ReportingStub
from frequenz.client.base.client import BaseApiClient
from frequenz.client.base.exception import ClientNotConnected
from frequenz.client.common.metric import Metric
from google.protobuf.timestamp_pb2 import Timestamp as PBTimestamp

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

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

@property
def stub(self) -> ReportingStub:
"""The gRPC stub for the API."""
if self.channel is None or self._stub is None:
raise ClientNotConnected(server_url=self.server_url, operation="stub")
return self._stub

# pylint: disable=too-many-arguments
async def list_single_component_data(
self,
Expand Down
Loading