[英]How can I run a flow several times using different parameters using Prefect?
How can I run a flow several times using different parameters?如何使用不同的参数多次运行流程? I'm trying to use create_flow_run.map like this:我正在尝试像这样使用 create_flow_run.map :
dump_to_gcs_flow = create_flow_run.map(
flow_name=unmapped(utils_constants.FLOW_DUMP_TO_GCS_NAME.value),
project_name=unmapped(constants.PREFECT_DEFAULT_PROJECT.value),
parameters=tables_to_zip,
labels=unmapped(current_flow_labels),
run_name=unmapped("Dump to GCS"),
)
except for parameters
all the other arguments are constants, so I use unmapped
on them.除了parameters
之外,所有其他 arguments 都是常量,所以我对它们使用unmapped
的。 tables_to_zip
is a list of dictionaries containing the parameters values for each table to be zip. tables_to_zip
是一个字典列表,其中包含要为 zip 的每个表的参数值。 However, this didn't work.然而,这并没有奏效。 I'm currently receiving the (somewhat crypt) error:我目前收到(有点隐秘)错误:
prefect.exceptions.ClientError: [{'message': 'parsing UUID failed, expected String, but encountered Array', 'locations': [{'line': 2, 'column': 5}], 'path': ['flow_run'], 'extensions': {'path': '$.selectionSet.flow_run.args.where.id._eq', 'code': 'parse-failed', 'exception': {'message': 'parsing UUID failed, expected String, but encountered Array'}}}]
what am I doing wrong here?我在这里做错了什么?
It would need to be a list of dictionaries with the key being parameter name - this Discourse topic discusses this problem in much more depth: https://discourse.prefect.io/t/how-to-map-over-flows-with-various-parameter-values/365/2它需要是一个字典列表,其中键是参数名称 - 这个 Discourse 主题更深入地讨论了这个问题: https://discourse.prefect.io/t/how-to-map-over-flows-with -各种参数值/365/2
LMK, if you still have issues implementing this pattern after reading this LMK,如果您在阅读本文后仍然遇到实施此模式的问题
(btw Prefect 2 is the default version now and makes this much easier: https://docs.prefect.io ) (顺便说一句,Prefect 2 现在是默认版本,这让这更容易: https://docs.prefect.io )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.