Skip to content

Canvas: result not forwarded to group members if those members are chains #1057

Closed

Description

@mkmatlock

I am attempting to build what is essentially a task tree structure using celery chains and groups. At each node I have a task chained to a group of chains.

The essential elements are captured in the following example:

    def test_add_group_chain(self):
        c1 = ( add_task.s(1) | add_task.s(2) )
        c2 = ( add_task.s(7) | add_task.s(3) )
        c3 = ( add_task.s(3,2) | group(c1, c2))

        res = c3()
        self.assertEqual([8, 15], res.get())

However, when running this example, I get:

TypeError: add_task() takes exactly 2 arguments (1 given)

The follow example, in which the group elements are not chains does work correctly:

    def test_add_group(self):
        c1 = ( add_task.s(3,2) | group( add_task.s(3), add_task.s(10) ))
        res = c1()
        self.assertEqual([8, 15], res.get())

So, it would appear that celery is not forwarding results to partial chains when they are group elements.

My tests use CELERY_ALWAYS_EAGER. I'm not sure if the examples work in a production environment.

Activity

  1. added a commit that references this issue on Nov 20, 2012
    22c1021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions