Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

celery: More precise typing for Celery.register_task(...) #168

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

alecbarber
Copy link
Contributor

Resolves #167

Celery.register_task returns the task instance that was registered, which might be a subclass of Task [1]. We can accurately capture this behaviour using a TypeVar.

[1] https://github.com/celery/celery/blob/3630e467361009a8b3f3050807ed16503d5c4441/celery/app/base.py#L609

@alecbarber alecbarber force-pushed the feat/celery-register-task branch from d331036 to 038ef8a Compare November 25, 2024 18:40
@sbdchd sbdchd added the automerge auto merge PRs using kodiak label Nov 25, 2024
@kodiakhq kodiakhq bot merged commit 6e05c79 into sbdchd:main Nov 26, 2024
2 checks passed
@sbdchd
Copy link
Owner

sbdchd commented Nov 26, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge auto merge PRs using kodiak
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Celery.register_task can be typed more precisely
2 participants