Skip to content

Commit 12becb4

Browse files
committed
refactor(assets): Removed the major issues parameter from the operational lifetime extraction function.
Signed-off-by: eduardiazf <[email protected]>
1 parent b5e92be commit 12becb4

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ def component_connection_from_proto_with_issues(
7373
)
7474
return None
7575

76-
lifetime = _get_operational_lifetime_from_proto(
77-
message, major_issues=major_issues, minor_issues=minor_issues
78-
)
76+
lifetime = _get_operational_lifetime_from_proto(message, minor_issues=minor_issues)
7977

8078
return ComponentConnection(
8179
source=source_component_id,
@@ -87,18 +85,11 @@ def component_connection_from_proto_with_issues(
8785
def _get_operational_lifetime_from_proto(
8886
message: electrical_components_pb2.ElectricalComponentConnection,
8987
*,
90-
major_issues: list[str],
9188
minor_issues: list[str],
9289
) -> Lifetime:
9390
"""Get the operational lifetime from a protobuf message."""
9491
if message.HasField("operational_lifetime"):
95-
try:
96-
return lifetime_from_proto(message.operational_lifetime)
97-
except ValueError as exc:
98-
major_issues.append(
99-
f"invalid operational lifetime ({exc}), considering it as missing "
100-
"(i.e. always operational)",
101-
)
92+
return lifetime_from_proto(message.operational_lifetime)
10293
else:
10394
minor_issues.append(
10495
"missing operational lifetime, considering it always operational",

0 commit comments

Comments
 (0)