Rafał Wojdyła
02/10/2021, 5:16 PMjosh
02/10/2021, 5:19 PMparameters
. So if you have a flow that takes a val
param you should be able to access it through {parameters[val]}
Rafał Wojdyła
02/10/2021, 5:21 PMjosh
02/10/2021, 5:28 PMtarget="{parameters[val]}"
and the Parameter is Parameter("val", default="asdf")
Rafał Wojdyła
02/10/2021, 5:28 PMjosh
02/10/2021, 5:28 PMRafał Wojdyła
02/10/2021, 5:29 PM0.11.2
, could you pls post the code you have used?self.location.format(prefect.context)
where the location has the parameter pattern akin to "[parameters[val]}"
, works when I specify the parameter explicitly, but doesn't for default value (fails with missing key).josh
02/10/2021, 5:33 PM0.14.7
). Here is the code I am using:
from prefect import Flow, task, Parameter
from prefect.engine.results import LocalResult
@task(target="{parameters[val]}")
def get_data(val):
return [val]
@task
def print_data(data):
print(data)
with Flow(
"using-targets",
result=LocalResult(),
) as flow:
val = Parameter("val", default="asdf")
data = get_data(val)
print_data(data)
flow.run()
Rafał Wojdyła
02/10/2021, 5:44 PMrequires
on another task. Is this something that Prefect supports?josh
02/10/2021, 5:46 PMRafał Wojdyła
02/10/2021, 5:49 PMStartFlowRun
)?josh
02/10/2021, 5:50 PMRafał Wojdyła
02/10/2021, 5:50 PMjosh
02/10/2021, 5:51 PMRafał Wojdyła
02/10/2021, 5:58 PM