Skip to content

Commit ce25c60

Browse files
committed
refactor: update protobuf imports and fix field references
- Changed the import paths for `location_pb2` and `bounds_pb2` to use the new `v1alpha8` version, ensuring compatibility with the latest API changes. - Updated the field reference in the `electrical_component_from_proto_with_issues` function to correctly access `category_specific_info.inverter.type`, improving the accuracy of the data handling. These changes enhance the integration with the updated protobuf definitions and improve the reliability of the electrical component processing. Signed-off-by: eduardiazf <[email protected]>
1 parent 3aaff3c commit ce25c60

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/frequenz/client/assets/_location_proto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import logging
77

8-
from frequenz.api.common.v1 import location_pb2
8+
from frequenz.api.common.v1alpha8.types import location_pb2
99

1010
from ._location import Location
1111

src/frequenz/client/assets/electrical_component/_electrical_component_proto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def electrical_component_from_proto_with_issues(
329329
InverterType.HYBRID: HybridInverter,
330330
}
331331
inverter_type = enum_proto.enum_from_proto(
332-
message.category_type.inverter.type, InverterType
332+
message.category_specific_info.inverter.type, InverterType
333333
)
334334
match inverter_type:
335335
case (

src/frequenz/client/assets/metrics/_bounds_proto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""Loading of Bounds objects from protobuf messages."""
55

66

7-
from frequenz.api.common.v1.metrics import bounds_pb2
7+
from frequenz.api.common.v1alpha8.metrics import bounds_pb2
88

99
from ._bounds import Bounds
1010

0 commit comments

Comments
 (0)