Sam Werbalowsky
03/03/2022, 9:40 PMparam=Parameter("myvalue", default="myvalue")
. I want to us it in a variety of tasks say…
execute = execute_file(f"sql/{param}.sql")
upload = upload_file(f"{param}.csv")
Is there a way to do this without constructing a task for each input?Kevin Kho
03/03/2022, 9:42 PMSam Werbalowsky
03/03/2022, 9:51 PMKevin Kho
03/03/2022, 10:01 PMparam
and template
so that you can use string formatting with template.format(param)
?Sam Werbalowsky
03/03/2022, 10:04 PMKevin Kho
03/03/2022, 10:14 PMfrom prefect import Flow, task, Parameter
import prefect
@task
def log(x):
<http://prefect.context.logger.info|prefect.context.logger.info>(x)
return 1
with Flow("...") as flow:
x = Parameter("x", "test")
log(task(lambda x: f"logging {x}")(x))
flow.run()