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 RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Upgrading

<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
* Update to frequenz-api-reporting v0.8.0

## New Features

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ requires-python = ">= 3.11, < 4"
dependencies = [
"typing_extensions >= 4.6.1, < 5",
"grpc-stubs == 1.53.0.6",
"frequenz-api-reporting >= 0.7.0, < 0.8",
"frequenz-api-reporting >= 0.8.0, < 0.9",
"frequenz-client-common >= 0.3.0, < 0.4",
"grpcio >=1.70.0, < 2",
"protobuf >= 5.29.3, < 7",
"grpcio >=1.72.1, < 2",
"protobuf >=6.31.1, < 7",
"frequenz-client-base >= 0.11.0, < 0.12.0",
]
dynamic = ["version"]
Expand Down
12 changes: 6 additions & 6 deletions src/frequenz/client/reporting/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ def dt2ts(dt: datetime) -> PBTimestamp:
return ts

time_filter = PBTimeFilter(
start=dt2ts(start_time) if start_time else None,
end=dt2ts(end_time) if end_time else None,
start_time=dt2ts(start_time) if start_time else None,
end_time=dt2ts(end_time) if end_time else None,
)

incl_states = (
Expand Down Expand Up @@ -450,8 +450,8 @@ def dt2ts(dt: datetime) -> PBTimestamp:
return ts

time_filter = PBTimeFilter(
start=dt2ts(start_time) if start_time else None,
end=dt2ts(end_time) if end_time else None,
start_time=dt2ts(start_time) if start_time else None,
end_time=dt2ts(end_time) if end_time else None,
)

incl_states = (
Expand Down Expand Up @@ -566,8 +566,8 @@ def dt2ts(dt: datetime) -> PBTimestamp:
return ts

time_filter = PBTimeFilter(
start=dt2ts(start_time) if start_time else None,
end=dt2ts(end_time) if end_time else None,
start_time=dt2ts(start_time) if start_time else None,
end_time=dt2ts(end_time) if end_time else None,
)

stream_filter = PBAggregatedStreamRequest.AggregationStreamFilter(
Expand Down
6 changes: 3 additions & 3 deletions src/frequenz/client/reporting/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __iter__(self) -> Iterator[MetricSample]:
for item in items:
cid = getattr(item, self.id_attr)
for sample in getattr(item, "metric_samples", []):
ts = sample.sampled_at.ToDatetime().replace(tzinfo=timezone.utc)
ts = sample.sample_time.ToDatetime().replace(tzinfo=timezone.utc)
met = Metric.from_proto(sample.metric).name

# Handle simple_metric
Expand Down Expand Up @@ -127,7 +127,7 @@ def __iter__(self) -> Iterator[MetricSample]:
)

for state in getattr(item, "states", []):
ts = state.sampled_at.ToDatetime().replace(tzinfo=timezone.utc)
ts = state.sample_time.ToDatetime().replace(tzinfo=timezone.utc)
for category, category_items in {
"state": getattr(state, "states", []),
"warning": getattr(state, "warnings", []),
Expand Down Expand Up @@ -177,7 +177,7 @@ class AggregatedMetric:
def sample(self) -> MetricSample:
"""Return the aggregated metric sample."""
return MetricSample(
timestamp=self._data_pb.sample.sampled_at.ToDatetime().replace(
timestamp=self._data_pb.sample.sample_time.ToDatetime().replace(
tzinfo=timezone.utc
),
microgrid_id=self._data_pb.aggregation_config.microgrid_id,
Expand Down
Loading