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
In pydantic v1 we used the validate_arguments decorator for many functions, including our celery tasks. To transition to pydantic v2, we replaced it with validate_call, which works fine, if not all arguments are given as keyword arguments.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Since this is about the interaction of two libraries, I'm not sure, where this should be asked. I've already posted a version of this question in the pydantic discussions.
In pydantic v1 we used the validate_arguments decorator for many functions, including our celery tasks. To transition to pydantic v2, we replaced it with validate_call, which works fine, if not all arguments are given as keyword arguments.
Now wait(2), wait('2'), wait(seconds=2), and wait.delay(2) work as expected, but
Am I doing something wrong? I've tried pydantic 2.2.1 and 2.3.0, 2.4.0, celery 5.3.1 and 5.3.4 on python 3.11.5.
EDIT: The problem can be avoided by defining the task as bound:
Do we have to define all our tasks as bound? Are there any negative consequences of bound tasks?
Beta Was this translation helpful? Give feedback.
All reactions