Skip to content

Commit 9fad9ab

Browse files
committed
fix: Fix return type
Signed-off-by: eduardiazf <eduardiazf@gmail.com>
1 parent fcaeedb commit 9fad9ab

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/frequenz/client/assets/_client.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ async def list_microgrid_electrical_component_connections(
227227
destination_component_ids: Iterable[ElectricalComponentId] = (),
228228
*,
229229
raise_on_errors: bool = False,
230-
) -> list[ComponentConnection | None]:
230+
) -> list[ComponentConnection]:
231231
"""
232232
Get the electrical component connections of a microgrid.
233233
@@ -290,11 +290,13 @@ async def list_microgrid_electrical_component_connections(
290290
f"{len(exceptions)} connection(s) failed validation",
291291
exceptions,
292292
)
293-
return valid_connections # type: ignore[return-value]
293+
return valid_connections
294294

295-
return list(
296-
map(
295+
return [
296+
c
297+
for c in map(
297298
component_connection_from_proto,
298299
filter(bool, response.connections),
299300
)
300-
)
301+
if c is not None
302+
]

0 commit comments

Comments
 (0)