Skip to content
Merged
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
6 changes: 3 additions & 3 deletions src/frequenz/client/reporting/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from collections import namedtuple
from dataclasses import dataclass
from datetime import datetime
from typing import Any, AsyncIterator, Awaitable, Generator, Type, cast
from typing import Any, AsyncIterator, Awaitable, Iterator, Type, cast

import grpc.aio as grpcaio

Expand Down Expand Up @@ -58,7 +58,7 @@ def is_empty(self) -> bool:
return True
return False

def iterate_metric_samples(self) -> Generator[MetricSample, None, None]:
def __iter__(self) -> Iterator[MetricSample]:
"""Get generator that iterates over all values in the page.

Note: So far only `SimpleMetricSample` in the `MetricSampleVariant`
Expand Down Expand Up @@ -149,7 +149,7 @@ async def iterate_single_component(
end_dt=end_dt,
page_size=page_size,
):
for entry in page.iterate_metric_samples():
for entry in page:
yield entry

# pylint: disable=too-many-arguments
Expand Down