File tree Expand file tree Collapse file tree 3 files changed +18
-7
lines changed
src/frequenz/client/reporting Expand file tree Collapse file tree 3 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 66
77## Upgrading
88
9- <!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
9+ * Update to use the newest release of api-reporting.
10+ This update has a dependency on the serivce as it introduces MetricConnections.
1011
1112## New Features
1213
Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ requires-python = ">= 3.11, < 4"
2828dependencies = [
2929 " typing_extensions >= 4.6.1, < 5" ,
3030 " grpc-stubs == 1.53.0.5" ,
31- " frequenz-api-reporting >= 0.2 .0, < 0.5 " ,
31+ " frequenz-api-reporting >= 0.5 .0, < 0.6 " ,
3232 " frequenz-client-common >= 0.2.0, < 0.3" ,
33- " grpcio >= 1.54.2 , < 2" ,
34- " grpcio-tools >= 1.54.2 , < 2" ,
35- " protobuf >= 4.25.3 , < 6" ,
33+ " grpcio >=1.66.1 , < 2" ,
34+ " grpcio-tools >=1.66.1 , < 2" ,
35+ " protobuf >=5.28.2 , < 6" ,
3636 " frequenz-client-base >= 0.8.0, < 0.9.0" ,
3737]
3838dynamic = [" version" ]
Original file line number Diff line number Diff line change 1616 MicrogridComponentIDs as PBMicrogridComponentIDs ,
1717)
1818from frequenz .api .reporting .v1 .reporting_pb2 import IncludeOptions as PBIncludeOptions
19+ from frequenz .api .reporting .v1 .reporting_pb2 import (
20+ MetricConnections as PBMetricConnections ,
21+ )
1922from frequenz .api .reporting .v1 .reporting_pb2 import (
2023 ReceiveMicrogridComponentsDataStreamRequest as PBReceiveMicrogridComponentsDataStreamRequest ,
2124)
@@ -65,6 +68,7 @@ def is_empty(self) -> bool:
6568 return True
6669 return False
6770
71+ # pylint: disable=too-many-locals
6872 def __iter__ (self ) -> Iterator [MetricSample ]:
6973 """Get generator that iterates over all values in the batch.
7074
@@ -317,11 +321,17 @@ def dt2ts(dt: datetime) -> PBTimestamp:
317321 include_options = include_options ,
318322 )
319323
320- metrics_pb = [metric .to_proto () for metric in metrics ]
324+ metric_conns_pb = [
325+ PBMetricConnections (
326+ metric = metric .to_proto (),
327+ connections = [],
328+ )
329+ for metric in metrics
330+ ]
321331
322332 request = PBReceiveMicrogridComponentsDataStreamRequest (
323333 microgrid_components = microgrid_components_pb ,
324- metrics = metrics_pb ,
334+ metrics = metric_conns_pb ,
325335 filter = stream_filter ,
326336 )
327337
You can’t perform that action at this time.
0 commit comments