Pārlūkot izejas kodu

Removes compat property AsyncResut.task_id (use .id)

Ask Solem 8 gadi atpakaļ
vecāks
revīzija
7fa32e03cb
3 mainītis faili ar 1 papildinājumiem un 16 dzēšanām
  1. 1 1
      celery/canvas.py
  2. 0 9
      celery/result.py
  3. 0 6
      celery/tests/tasks/test_result.py

+ 1 - 1
celery/canvas.py

@@ -644,7 +644,7 @@ class chain(Signature):
                 results.pop()
                 task = chord(
                     task, body=prev_task,
-                    task_id=prev_res.task_id, root_id=root_id, app=app,
+                    task_id=prev_res.id, root_id=root_id, app=app,
                 )
                 prev_res = prev_prev_res
             if is_last_task:

+ 0 - 9
celery/result.py

@@ -415,15 +415,6 @@ class AsyncResult(ResultBase):
         """
         return self._get_task_meta()['status']
 
-    @property
-    def task_id(self):
-        """compat alias to :attr:`id`"""
-        return self.id
-
-    @task_id.setter  # noqa
-    def task_id(self, id):
-        self.id = id
-
 
 @Thenable.register
 class ResultSet(ResultBase):

+ 0 - 6
celery/tests/tasks/test_result.py

@@ -90,12 +90,6 @@ class test_AsyncResult(AppCase):
         with self.assertRaises(ValueError):
             AsyncResult(None, app=self.app)
 
-    def test_compat_properties(self):
-        x = self.app.AsyncResult('1')
-        self.assertEqual(x.task_id, x.id)
-        x.task_id = '2'
-        self.assertEqual(x.id, '2')
-
     @depends_on_current_app
     def test_reduce_direct(self):
         x = AsyncResult('1', app=self.app)