Skip to content

fix: Context.children is list[AsyncResult[Any]], not list[str] - #232

Merged
kodiakhq[bot] merged 1 commit into
sbdchd:mainfrom
ghostbranch-33:fix/context-children-type
Aug 28, 2026
Merged

kodiakhq[bot] merged 1 commit into
sbdchd:mainfrom
ghostbranch-33:fix/context-children-type

Conversation

@ghostbranch-33

Copy link
Copy Markdown
Contributor

Task.add_trail() appends the actual result object (GroupResult/AsyncResult or EagerResult in eager mode) to Context.children, not the string task ID.

see celery/app/task.py::Task.add_trail and its caller in celery/canvas.py.

This matches how AsyncResult.children is already typed in result.pyi.

Added a regression test asserting the type via self.request.children in a bound task. Verified with mypy --strict tests/test_celery.py

@sbdchd sbdchd left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sbdchd sbdchd added the automerge auto merge PRs using kodiak label Aug 28, 2026
@kodiakhq
kodiakhq Bot merged commit 6aed91d into sbdchd:main Aug 28, 2026
2 checks passed
Sanjays2402 added a commit to Sanjays2402/celery-types that referenced this pull request Sep 10, 2026
Keeps both appended regression tests in tests/test_celery.py:
the Context.children assertion from sbdchd#232 and
test_async_result_as_list from this PR.
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.

2 participants