From 8e25ab05498a01d3152054189d09c7f76d7f5778 Mon Sep 17 00:00:00 2001 From: Alberto Mulone Date: Sun, 3 Dec 2023 22:16:55 +0100 Subject: [PATCH] minor fix --- streamflow/core/utils.py | 3 ++- streamflow/cwl/processor.py | 2 +- streamflow/workflow/step.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/streamflow/core/utils.py b/streamflow/core/utils.py index 58c8181c7..246c15f5b 100644 --- a/streamflow/core/utils.py +++ b/streamflow/core/utils.py @@ -286,6 +286,8 @@ async def get_dependencies( context: StreamFlowContext, loading_context: DatabaseLoadingContext, ): + # This method is generally called from the step load method. If the change_wf is enabled, + # it is not helpful to get the Port instance in loading_context if load_ports: ports = await asyncio.gather( *( @@ -295,7 +297,6 @@ async def get_dependencies( ) return {d["name"]: p.name for d, p in zip(dependency_rows, ports)} else: - # it is not helpful to have the Port instance in loading_context when it is loading on a new workflow port_rows = await asyncio.gather( *( asyncio.create_task(context.database.get_port(d["port"])) diff --git a/streamflow/cwl/processor.py b/streamflow/cwl/processor.py index 886640c33..00c7f6287 100644 --- a/streamflow/cwl/processor.py +++ b/streamflow/cwl/processor.py @@ -166,7 +166,7 @@ async def _load( format_graph.parse(data=row["format_graph"]) if row["format_graph"] is not None else None - ), # todo: fix multiple instance + ), # todo: fix multiple instances full_js=row["full_js"], load_contents=row["load_contents"], load_listing=LoadListing(row["load_listing"]) diff --git a/streamflow/workflow/step.py b/streamflow/workflow/step.py index 5cffa7d18..a08e3ee2a 100644 --- a/streamflow/workflow/step.py +++ b/streamflow/workflow/step.py @@ -57,8 +57,8 @@ async def _get_port( ): if change_wf: port_row = await context.database.get_port(port_id) - if port_row["name"] in change_wf.ports.keys(): - return change_wf.ports[port_row["name"]] + if port := change_wf.ports.get(port_row["name"]): + return port # If the port is not available in the new workflow, a new one must be created return await Port.load(context, port_id, loading_context, change_wf)