【发布时间】:2021-04-30 11:28:32
【问题描述】:
我正在使用metaflow创建如下文本处理管道:-
___F------
______ D---| |
| |___G---| |__>
____B-----| |----->H
| |______E_________________> ^
A -| |
|____C________________________________|
根据documentation,branch 允许并行计算步骤,用于并行计算 (B, C)、(D, E) 和 (F, G)。最后所有的分支都在 H 处加入。下面是实现这个逻辑的代码:-
from metaflow import FlowSpec, step
class TextProcessing(FlowSpec):
@step
def a(self):
....
self.next(self.b, self.c)
@step
def c(self):
result1 = {}
....
self.next(self.join)
@step
def b(self):
....
self.next(self.d, self.e)
@step
def e(self):
result2 = []
.....
self.next(self.join)
@step
def d(self):
....
self.next(self.f, self.g)
@step
def f(self):
result3 = []
....
self.next(self.join)
@step
def g(self):
result4 = []
.....
self.next(self.join)
@step
def join(self, results):
data = [results.c.result, results.e.result2, result.f.result3, result.g.result4]
print(data)
self.next(self.end)
@step
def end(self):
pass
etl = TextProcessing()
在运行 python main.py run 时,我收到以下错误:-
Metaflow 2.2.10 executing TextProcessing for user:ubuntu
Validating your flow...
Validity checker found an issue on line 83:
Step join seems like a join step (it takes an extra input argument) but an incorrect number of steps (c, e, f, g) lead to it. This join was expecting 2 incoming paths, starting from splitted step(s) f, g.
谁能指出我哪里出错了?
【问题讨论】: