Can I set up a case statement to check whether it is the weekend or a weekday? https://docs.prefect.io/core/idioms/conditional.html . I want to do something like with case(condition, 6 or 7): with the numbers referring to a check_condition that returns the day of the week.
Jason Motley
01/07/2022, 4:15 PM
Something like this:
Copy code
@task(name = "Check Day of Week", log_stdout=True, max_retries=3, retry_delay=timedelta(seconds=10))
def daycheck():
day = datetime.today().weekday()
return(day)
with flow():
with case(condition >= 6):
bla bla
k
Kevin Kho
01/07/2022, 4:16 PM
You would need an intermediate task that returns True or False for this since case is just for equality
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.