在Kedro管道中,节点(类似于python函数)是顺序声明的。在某些情况下,一个节点的输入就是前一个节点的输出。但是,有时,在命令行中调用kedro run API时,节点不会按顺序运行。
在kedro文档中,它说默认情况下按顺序运行节点。
我的run.py代码:
def main(
tags: Iterable[str] = None,
env: str = None,
runner: Type[AbstractRunner] = None,
node_names: Iterable[str] = None,
from_nodes: Iterable[str] = None,
to_nodes: Iterable[str] = None,
from_inputs: Iterable[str] = None,
):
project_context = ProjectContext(Path.cwd(), env=env)
project_context.run(
tags=tags,
runner=runner,
node_names=node_names,
from_nodes=from_nodes,
to_nodes=to_nodes,
from_inputs=from_inputs,
)
当前,我的最后一个节点有时在我的前几个节点之前运行。
答案 0 :(得分:2)
我从Kedro github上得到的答案:
管道仅根据以下内容确定节点的执行顺序 目前的数据集依存关系(节点输入和输出)。所以 指示节点A应该在节点B之前运行的唯一选择 将虚拟数据集作为节点A的输出和节点B的输入。