You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than pass context variables explicitly as kwargs, supply them as variables that are set via context manager
Task Definition (user code)
fromprefect.contextimportas_of_dateclassMyTask:
defrun(self):
""" return True if this task's as-of-date is today """ifas_of_date.date() ==datetime.now().date():
returnTrueelse:
returnFalse
TaskRunner (Prefect code)
# context manager sets the values of variables like as_of_datewithprefect.context.set_context(context):
my_task.run()
The text was updated successfully, but these errors were encountered:
Rather than pass context variables explicitly as
kwargs
, supply them as variables that are set via context managerTask Definition (user code)
TaskRunner (Prefect code)
The text was updated successfully, but these errors were encountered: