https://prefect.io logo
m

Matthias

03/25/2022, 1:49 PM
Orion question: is there an equivalent of `Parameter`’s from Prefect 1.0?
k

Kevin Kho

03/25/2022, 1:49 PM
It’s the inputs into your
flow
so it’s not a task
Copy code
@flow
def abc(x: int, y:int):
    ....
it’s x and y here
👍 1
m

Matthias

03/25/2022, 2:07 PM
But you can set them from the Orion server?
k

Kevin Kho

03/25/2022, 2:17 PM
On the deployment you can. From UI I don’t think it’s there yet
👍 2
m

Matthias

03/26/2022, 7:22 AM
Do you happen to have an example somewhere?
k

Kevin Kho

03/26/2022, 2:05 PM
Copy code
from prefect import flow, task
from prefect.deployments import DeploymentSpec
from datetime import timedelta

@task
def abc(x):
    return x+1

@flow
def myflow(x:int):
    abc(x)

DeploymentSpec(
    flow=myflow,
    name="hello-world-daily",
    parameters={"x": 1}
)
👍 1
m

Matthias

03/26/2022, 7:45 PM
Thanks @Kevin Kho. This is exactly what I need!
👍 1
20 Views