Skip to content

Commit

Permalink
Another fix for link_error signatures being dicts instead of `Sig…
Browse files Browse the repository at this point in the history
…nature`s (#8841)

* Another fix for `link_error` signatures being `dict`s instead of `Signature`s

Related to #8678

* whitespace

* typo

* adding unittest

* typo
  • Loading branch information
murrple-1 committed Feb 13, 2024
1 parent acae57f commit d80fb30
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions celery/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,8 @@ def link_error(self, sig):
#
# We return a concretised tuple of the signatures actually applied to
# each child task signature, of which there might be none!
sig = maybe_signature(sig)

return tuple(child_task.link_error(sig.clone(immutable=True)) for child_task in self.tasks)

def _prepared(self, tasks, partial_args, group_id, root_id, app,
Expand Down
10 changes: 10 additions & 0 deletions t/unit/tasks/test_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,16 @@ def test_link_error(self):
for child_sig in g1.tasks:
child_sig.link_error.assert_called_with(sig.clone(immutable=True))

def test_link_error_with_dict_sig(self):
g1 = group(Mock(name='t1'), Mock(name='t2'), app=self.app)
errback = signature('tcb')
errback_dict = dict(errback)
g1.link_error(errback_dict)
# We expect that all group children will be given the errback to ensure
# it gets called
for child_sig in g1.tasks:
child_sig.link_error.assert_called_with(errback.clone(immutable=True))

def test_apply_empty(self):
x = group(app=self.app)
x.apply()
Expand Down

0 comments on commit d80fb30

Please sign in to comment.