Skip to content

Commit 0085f4b

Browse files
author
Andrei Neagu
committed
outputs_callback is now totally optional
1 parent bf7408a commit 0085f4b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/simcore-sdk/src/simcore_sdk/node_ports_v2/nodeports_v2.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,13 @@ async def _set_with_notifications(
180180
set_kwargs: SetKWargs | None,
181181
sub_progress: ProgressBarData,
182182
) -> None:
183-
assert outputs_callbacks is not None # nosec
184183
try:
185184
# pylint: disable=protected-access
186185
await self.internal_outputs[port_key]._set( # noqa: SLF001
187186
value, set_kwargs=set_kwargs, progress_bar=sub_progress
188187
)
189-
await outputs_callbacks.finished_succesfully(port_key)
188+
if outputs_callbacks:
189+
await outputs_callbacks.finished_succesfully(port_key)
190190
except UnboundPortError:
191191
# not available try inputs
192192
# if this fails it will raise another exception
@@ -195,10 +195,12 @@ async def _set_with_notifications(
195195
value, set_kwargs=set_kwargs, progress_bar=sub_progress
196196
)
197197
except CancelledError:
198-
await outputs_callbacks.aborted(port_key)
198+
if outputs_callbacks:
199+
await outputs_callbacks.aborted(port_key)
199200
raise
200201
except Exception:
201-
await outputs_callbacks.finished_with_error(port_key)
202+
if outputs_callbacks:
203+
await outputs_callbacks.finished_with_error(port_key)
202204
raise
203205

204206
tasks = []

0 commit comments

Comments
 (0)