title: Python Celery group() - TypeError: [...] argument after ** must be a mapping, not long
body: <p>I'm trying to run a celery (3.1.17) task that executes further tasks in a group but I always run into errors. This is how I set up the code:</p>
  
  <pre><code>from celery import task, group
  
  @task
  def daily_emails():
  
      [...]
  
      all_tasks = []
  
      for chunk in range(0, users.count(), 1000):
          some_users = users[chunk:chunk+1000]
          all_tasks.append(write_email_bunch.subtask(some_users, execnum))
  
      job = group(all_tasks)
      # result = job.apply_async()
      # job.get()
      result = job.delay()
      print result
      results = result.join()
      print results
  
      print "done writing email tasks"
      count = sum(results)
      print count
  
  
  @task
  def write_email_bunch(some_users, execnum):
  
      [...]
  
      return len(some_users) - skipped_email_count
  </code></pre>
  
  <p>And this is the output:</p>
  
  <pre><code>&lt;GroupResult: 3d766c85-21af-4ed0-90cb-a1ca2d281db1 [69527252-8468-4358-9328-144f727f372b, 6d03d86e-1b69-4f43-832e-bd27c4dfc092, 1d868d1b-b502-4672-9895-430089e9532e]&gt;
  Traceback (most recent call last):
    File "send_daily_emails.py", line 8, in &lt;module&gt;
      daily_emails()
    File "/var/www/virtualenvs/nt_dev/local/lib/python2.7/site-packages/celery/app/task.py", line 420, in __call__
      return self.run(*args, **kwargs)
    File "/var/www/nt_dev/nt/apps/emails/tasks.py", line 124, in daily_emails
      results = result.join()
    File "/var/www/virtualenvs/nt_dev/local/lib/python2.7/site-packages/celery/result.py", line 642, in join
      interval=interval, no_ack=no_ack,
    File "/var/www/virtualenvs/nt_dev/local/lib/python2.7/site-packages/celery/result.py", line 870, in get
      raise self.result
  TypeError: write_email_bunch() argument after ** must be a mapping, not long
  </code></pre>
  
  <p>So I get a GroupResult but somehow Im unable to join it or further process it.
  And when I use <em>write_email_bunch.s(some_users, execnum)</em> I get this exception:</p>
  
  <pre><code>  File "/var/www/virtualenvs/nt_dev/local/lib/python2.7/site-packages/celery/result.py", line 870, in get
      raise self.result
  TypeError: 'tuple' object is not callable
  </code></pre>
  
  <p>How would I wait for all the Group Tasks to be completed to continue afterwards? 
  <em>job.get()</em> gives me this exception:</p>
  
  <pre><code>TypeError: get expected at least 1 arguments, got 0
  </code></pre>