@@ -40,11 +40,11 @@ class TaskAbortedError(Exception): ...
4040def _async_task_wrapper (
4141 app : Celery ,
4242) -> Callable [
43- [Callable [Concatenate [AbortableTask , P ], Coroutine [Any , Any , R ]]],
43+ [Callable [Concatenate [AbortableTask , TaskId , P ], Coroutine [Any , Any , R ]]],
4444 Callable [Concatenate [AbortableTask , P ], R ],
4545]:
4646 def decorator (
47- coro : Callable [Concatenate [AbortableTask , P ], Coroutine [Any , Any , R ]],
47+ coro : Callable [Concatenate [AbortableTask , TaskId , P ], Coroutine [Any , Any , R ]],
4848 ) -> Callable [Concatenate [AbortableTask , P ], R ]:
4949 @wraps (coro )
5050 def wrapper (task : AbortableTask , * args : P .args , ** kwargs : P .kwargs ) -> R :
@@ -56,7 +56,7 @@ async def run_task(task_id: TaskID) -> R:
5656 try :
5757 async with asyncio .TaskGroup () as tg :
5858 main_task = tg .create_task (
59- coro (task , * args , ** kwargs ),
59+ coro (task , task_id , * args , ** kwargs ),
6060 )
6161
6262 async def abort_monitor ():
@@ -205,5 +205,4 @@ def register_task( # type: ignore[misc]
205205 bind = True ,
206206 base = AbortableTask ,
207207 time_limit = None if timeout is None else timeout .total_seconds (),
208- pydantic = True ,
209208 )(wrapped_fn )
0 commit comments