Skip to content

Commit fb48aa6

Browse files
committed
fix: Fix return type
1 parent 24bc406 commit fb48aa6

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/frequenz/client/assets/_client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@
4040
"""The default timeout for gRPC calls made by this client (in seconds)."""
4141

4242

43-
class AssetsApiClient(
44-
BaseApiClient[assets_pb2_grpc.PlatformAssetsStub]
45-
): # pylint: disable=too-many-arguments
43+
class AssetsApiClient(BaseApiClient[assets_pb2_grpc.PlatformAssetsStub]): # pylint: disable=too-many-arguments
4644
"""A client for the Assets API."""
4745

4846
def __init__(
@@ -227,7 +225,7 @@ async def list_microgrid_electrical_component_connections(
227225
destination_component_ids: Iterable[ElectricalComponentId] = (),
228226
*,
229227
raise_on_errors: bool = False,
230-
) -> list[ComponentConnection | None]:
228+
) -> list[ComponentConnection]:
231229
"""
232230
Get the electrical component connections of a microgrid.
233231
@@ -290,11 +288,13 @@ async def list_microgrid_electrical_component_connections(
290288
f"{len(exceptions)} connection(s) failed validation",
291289
exceptions,
292290
)
293-
return valid_connections # type: ignore[return-value]
291+
return valid_connections
294292

295-
return list(
296-
map(
293+
return [
294+
c
295+
for c in map(
297296
component_connection_from_proto,
298297
filter(bool, response.connections),
299298
)
300-
)
299+
if c is not None
300+
]

0 commit comments

Comments
 (0)