Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LanderOtto committed Dec 3, 2023
1 parent 05109b7 commit 8e25ab0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion streamflow/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
*(
Expand All @@ -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"]))
Expand Down
2 changes: 1 addition & 1 deletion streamflow/cwl/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
4 changes: 2 additions & 2 deletions streamflow/workflow/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8e25ab0

Please sign in to comment.