Aleksandr Glushko
11/24/2021, 4:34 PMwith Flow('flow_name') as flow:
a = prefect.Parameter('a', 'required'=True)
<http://logger.info|logger.info>(a)
how can i get the parameter value to be used? So i want a
to be 1, but I get: a = <Parameter: a>
Im running the flow in the following way:
prefect_client.graphql(query= """
mutation{
create_flow_run(input: { flow_id: %s , parameters: %s}) {
id
}
}
""" % (train_flow_id, json.dumps(flow_params).replace('"', '\"'))
)
where flow_params is a dictionaryAnna Geller
from prefect import task, Flow, Parameter
@task(log_stdout=True)
def hello_world(name):
print(f"hello {name}")
with Flow("mini.example") as flow:
name = Parameter("name", default="Aleksandr")
hw = hello_world(name)
if __name__ == "__main__":
flow.run()
Aleksandr Glushko
11/24/2021, 4:38 PMAnna Geller
Aleksandr Glushko
11/24/2021, 4:41 PM