-
Does anybody have an example how to set task arguments with the non-task-decorator notation? I have no issues using the max_retries or other task arguments when I use the task decorator:
but than if I try to do more complex prefect task classes:
I get some binding errors:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
@JackDapid Try setting the task arguments at initialization like this: class MyPrefectTask(Task):
def __init__(self, df=None, **kwargs):
....
my_task = MyPrefectTask(max_retries=10, retry_delay=datetime.timedelta(seconds=5)) |
Beta Was this translation helpful? Give feedback.
-
Thanks @cicdw, yes I have used the decorator notation @task for that successfully before, I use the class notation for other reasons, but I totally agree fro others that have the same questions your comment will be very helpfull, thank you |
Beta Was this translation helpful? Give feedback.
@JackDapid Try setting the task arguments at initialization like this: