Commit c6a0bdb9 authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

Use as_tuple() instead of serializable()

serializable() and from_serializable() are deprecated in flavor of as_tuple()
and result_from_tuple().
This is required to migrate to celery 4
parent 434cc13f80df
......@@ -19,7 +19,7 @@
import six
import celery
from celery.result import AsyncResult, from_serializable
from celery.result import AsyncResult, result_from_tuple
from cubicweb import NoResultError
from cubicweb.entities import AnyEntity, fetch_config
......@@ -297,7 +297,7 @@ class CeleryTaskAdapter(ICeleryTask):
rresult = result.result
if (isinstance(rresult, dict)
and "celerytask_subtasks" in rresult):
subtasks = from_serializable(
subtasks = result_from_tuple(
for r in tree(subtasks, seen):
yield r
......@@ -87,5 +87,5 @@ def tsum(args):
def spawn(self):
return {
"celerytask_subtasks": chord((success.s(i) for i in range(10)),
tsum.s() | add.s(-45))().serializable(),
tsum.s() | add.s(-45))().as_tuple(),
......@@ -217,7 +217,7 @@ class CeleryTaskTC(BaseCeleryTaskTC):
self.assertEqual(cwtask.task_name, u'spawn')
asresult = self.wait_async_task(cnx, cwtask.task_id)
result = celery.result.from_serializable(
result = celery.result.result_from_tuple(
self.assertEqual(0, result.get())
cwtask = cnx.entity_from_eid(cwtask.eid)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment