fix(knext): bugfix in dag construction (#192)

This commit is contained in:
Qu 2024-04-03 14:41:12 +08:00 committed by GitHub
parent 497da2e1b8
commit 9191613d2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View File

@ -81,5 +81,6 @@ class Chain(Runnable, RESTable):
for end_node in end_nodes:
for start_node in start_nodes:
combined_dag.add_edge(end_node, start_node)
dag_list.append(combined_dag)
final_dag = nx.compose_all(dag_list)
return Chain(dag=final_dag)

View File

@ -105,7 +105,7 @@ class Component(Runnable, RESTable, ABC):
if len(end_nodes) > 0 and len(start_nodes) > 0:
for end_node in end_nodes:
for start_node in start_nodes:
combined_dag.add_edge(end_node, start_node)
dag.add_edge(end_node, start_node)
combined_dag = nx.compose(dag, o.dag)
dag_list.append(combined_dag)
final_dag = nx.compose_all(dag_list)

View File

@ -21,7 +21,7 @@ from stat import S_IWUSR as OWNER_WRITE_PERMISSION
def render_template(
root: Union[str, os.PathLike], file: Union[str, os.PathLike], **kwargs: Any
) -> None:
env = Environment(loader=FileSystemLoader(root))
env = Environment(loader=FileSystemLoader(root), autoescape=False)
template = env.get_template(str(file))
content = template.render(kwargs)