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
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## Upgrading

* Update and fix readme to make use of newest release version 0.8.0
* Updates the base client to version 0.6.

## New Features

Expand Down
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[grpcio] >= 0.5.0, < 0.6.0",
"frequenz-client-base >= 0.6.0, < 0.7.0",
]
dynamic = ["version"]

Expand Down
4 changes: 2 additions & 2 deletions src/frequenz/client/reporting/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __iter__(self) -> Iterator[MetricSample]:
)


class ReportingApiClient(BaseApiClient[ReportingStub, grpcaio.Channel]):
class ReportingApiClient(BaseApiClient[ReportingStub]):
"""A client for the Reporting service."""

def __init__(self, server_url: str, key: str | None = None) -> None:
Expand All @@ -147,7 +147,7 @@ def __init__(self, server_url: str, key: str | None = None) -> None:
server_url: The URL of the Reporting service.
key: The API key for the authorization.
"""
super().__init__(server_url, ReportingStub, grpcaio.Channel)
super().__init__(server_url, ReportingStub)

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

Expand Down
7 changes: 2 additions & 5 deletions tests/test_client_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""Tests for the frequenz.client.reporting package."""
from unittest.mock import MagicMock, patch

import grpc.aio as grpcaio
import pytest
from frequenz.api.reporting.v1.reporting_pb2_grpc import ReportingStub
from frequenz.client.base.client import BaseApiClient
Expand All @@ -15,12 +14,10 @@

@pytest.mark.asyncio
async def test_client_initialization() -> None:
"""Test that the client initializes the BaseApiClient with grpcaio.Channel."""
"""Test that the client initializes the BaseApiClient."""
with patch.object(BaseApiClient, "__init__", return_value=None) as mock_base_init:
client = ReportingApiClient("gprc://localhost:50051") # noqa: F841
mock_base_init.assert_called_once_with(
"gprc://localhost:50051", ReportingStub, grpcaio.Channel
)
mock_base_init.assert_called_once_with("gprc://localhost:50051", ReportingStub)


def test_components_data_batch_is_empty_true() -> None:
Expand Down
Loading