Skip to content

Commit 1bd0550

Browse files
Update client to use FilterOptions (#150)
Addresses the reporting-api update #147 and changes the client accordingly.
2 parents 9c3bf10 + 9130f36 commit 1bd0550

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
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+
* Updates 'FilterOption' in client to be able to use reporting-api version 0.7.0
1010

1111
## New Features
1212

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ requires-python = ">= 3.11, < 4"
2828
dependencies = [
2929
"typing_extensions >= 4.6.1, < 5",
3030
"grpc-stubs == 1.53.0.5",
31-
"frequenz-api-reporting >= 0.5.0, < 0.6",
31+
"frequenz-api-reporting >= 0.7.0, < 0.8",
3232
"frequenz-client-common >= 0.3.0, < 0.4",
33-
"grpcio >=1.66.1, < 2",
34-
"grpcio-tools >=1.66.1, < 2",
35-
"protobuf >=5.28.3, < 6",
33+
"grpcio >=1.70.0, < 2",
34+
"grpcio-tools >=1.70.0, < 2",
35+
"protobuf >=5.29.3, < 6",
3636
"frequenz-client-base >= 0.8.0, < 0.10.0",
3737
]
3838
dynamic = ["version"]

src/frequenz/client/reporting/_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from frequenz.api.reporting.v1.reporting_pb2 import (
1919
AggregationConfig as PBAggregationConfig,
2020
)
21-
from frequenz.api.reporting.v1.reporting_pb2 import IncludeOptions as PBIncludeOptions
21+
from frequenz.api.reporting.v1.reporting_pb2 import FilterOption as PBFilterOption
2222
from frequenz.api.reporting.v1.reporting_pb2 import (
2323
MetricConnections as PBMetricConnections,
2424
)
@@ -327,16 +327,16 @@ def dt2ts(dt: datetime) -> PBTimestamp:
327327
)
328328

329329
incl_states = (
330-
PBIncludeOptions.FilterOption.FILTER_OPTION_INCLUDE
330+
PBFilterOption.FILTER_OPTION_INCLUDE
331331
if include_states
332-
else PBIncludeOptions.FilterOption.FILTER_OPTION_EXCLUDE
332+
else PBFilterOption.FILTER_OPTION_EXCLUDE
333333
)
334334
incl_bounds = (
335-
PBIncludeOptions.FilterOption.FILTER_OPTION_INCLUDE
335+
PBFilterOption.FILTER_OPTION_INCLUDE
336336
if include_bounds
337-
else PBIncludeOptions.FilterOption.FILTER_OPTION_EXCLUDE
337+
else PBFilterOption.FILTER_OPTION_EXCLUDE
338338
)
339-
include_options = PBIncludeOptions(
339+
include_options = PBReceiveMicrogridComponentsDataStreamRequest.IncludeOptions(
340340
bounds=incl_bounds,
341341
states=incl_states,
342342
)

0 commit comments

Comments
 (0)