Skip to content

Commit f4dea27

Browse files
committed
Ensure timezone-aware timestamps in formula endpoint result
1 parent 2f17930 commit f4dea27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/frequenz/client/reporting/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class AggregatedMetric:
164164
def sample(self) -> MetricSample:
165165
"""Return the aggregated metric sample."""
166166
return MetricSample(
167-
timestamp=self._data_pb.sample.sampled_at.ToDatetime(),
167+
timestamp=self._data_pb.sample.sampled_at.ToDatetime().replace(tzinfo=timezone.utc),
168168
microgrid_id=self._data_pb.aggregation_config.microgrid_id,
169169
component_id=self._data_pb.aggregation_config.aggregation_formula,
170170
metric=self._data_pb.aggregation_config.metric,

0 commit comments

Comments
 (0)