So I had registered the flow yesterday and yesterday it worked fine
Prateek Saigal
01/21/2022, 5:14 PM
But today it is picking up the yesterday's date only
k
Kevin Kho
01/21/2022, 5:15 PM
Is that related to your schedule or do you have a date Parameter in your flow?
p
Prateek Saigal
01/21/2022, 5:15 PM
Copy code
# -- Write you flows here
with Flow(workflow_name) as flow:
today_date = datetime.datetime.now(pytz.timezone('Asia/Kolkata')).strftime("%Y%m%d")
date = Parameter("date", default=today_date
k
Kevin Kho
01/21/2022, 5:16 PM
Yeah exactly. That date is fixed during the registration time. You need to make it a task so that it’s evaluated during runtime.
Kevin Kho
01/21/2022, 5:18 PM
Copy code
@task
def get_date(val):
if val == None:
return datetime.datetime.now(pytz.timezone('Asia/Kolkata')).strftime("%Y%m%d")
with Flow(...) as flow:
the_date = Parameter("today", default=None)
the_date = get_date(the_date)
p
Prateek Saigal
01/21/2022, 5:20 PM
Thanks Kevin - let me try this and get back
k
Kevin Kho
01/21/2022, 5:20 PM
The issue is the default is evaluated immediately during registration
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.