https://prefect.io logo
f

FuETL

03/21/2022, 6:19 PM
Hey guys, i have 2 parameters that at least one should be provided. Prefect have a built-in function to handle this case or should i create a task and validate inside? Thanks!
k

Kevin Kho

03/21/2022, 6:20 PM
We don’t have a built-in function for that. I think you’d need to make your own task that raises a Failed state
f

FuETL

03/21/2022, 6:21 PM
Great! Thanks Kevin!! Is like a required_if
k

Kevin Kho

03/21/2022, 6:23 PM
Copy code
@task
def one_of(x, y):
    if (x or y) == None:
        raise FAIL()
    return
like that? I dunno 😆
5 Views