【发布时间】:2021-07-26 23:05:12
【问题描述】:
我在 beam.Map 中使用了这个函数:
def to_row(self, record):
tags = {
"foo": "bar"
}
x = {**tags}
return beam.Row(
date=record.get("date"),
value=record.get("input_value").get("value"),
)
当函数在管道中运行时,由于语句 x={**tags},它会中断并给出以下错误:
TypeError: Attempted to determine schema for unsupported type 'Any'
如果我删除 x=... 语句,一切正常。
我知道 Apache Beam 是在 python 中输入的,但我真的不明白为什么我不能解压值。
有没有办法在没有这个问题的情况下正确解包?理想情况下,我想将 Dict[str,str] 传递给 beam.Row 没有任何问题。
【问题讨论】:
标签: python apache-beam