Checklist
Related Issues and Possible Duplicates
Related Issues
Possible Duplicates
Brief Summary
Design
Architectural Considerations
None
Proposed Behavior
Celery tasks created with @app.task should support typing.get_type_hints(my_celery_task).
It can be solved by copying the __annotations__ from the decorated function when available. This is done by functools.wraps() in Python 3.0+, if I understand PEP 3107 correctly. Without this typing.get_type_hints(my_celery_task) raises an exception.
It is my understanding that some other similar properties that functools.wraps handles are already copied:
|
'__doc__': fun.__doc__, |
|
'__module__': fun.__module__, |
Proposed UI/UX
Diagrams
N/A
Alternatives
None
Checklist
for similar or identical feature requests.
for existing proposed implementations of this feature.
to find out if the if the same feature was already implemented in the
master branch.
in this issue (If there are none, check this box anyway).
Related Issues and Possible Duplicates
Related Issues
Possible Duplicates
Brief Summary
Design
Architectural Considerations
None
Proposed Behavior
Celery tasks created with
@app.taskshould supporttyping.get_type_hints(my_celery_task).It can be solved by copying the
__annotations__from the decorated function when available. This is done byfunctools.wraps()in Python 3.0+, if I understand PEP 3107 correctly. Without thistyping.get_type_hints(my_celery_task)raises an exception.It is my understanding that some other similar properties that
functools.wrapshandles are already copied:celery/celery/app/base.py
Lines 453 to 454 in d3863d9
Proposed UI/UX
Diagrams
N/A
Alternatives
None