Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ Change Log

Unreleased
~~~~~~~~~~

[3.4.3] - 2025-08-06
~~~~~~~~~~~~~~~~~~~~

Fixed
+++++
* Fix Celery protocol v2 header parameter name from ``task_id`` to ``id`` in ``extract_proto2_headers`` function

[3.4.2] - 2025-06-24
~~~~~~~~~~~~~~~~~~~~

Expand Down
6 changes: 3 additions & 3 deletions tests/test_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def test_create_user_task_protocol_v2(self):
{'callbacks': [], 'errbacks': [], 'task_chain': None, 'chord': None}
)
headers = {
'task_id': 'tid', 'retries': 0, 'eta': None, 'expires': None,
'id': 'tid', 'retries': 0, 'eta': None, 'expires': None,
'group': None, 'timelimit': [None, None], 'task': 'test_signals.sample_task'
}
create_user_task(sender='test_signals.sample_task', body=body, headers=headers)
Expand Down Expand Up @@ -565,7 +565,7 @@ class TestUtils:

def test_extract_proto2_headers(self):
headers = extract_proto2_headers(
task_id='abc123', retries=2, eta='2025-05-30T12:00:00',
id='abc123', retries=2, eta='2025-05-30T12:00:00',
expires=None, group='group1', timelimit=[10, 20],
task='my_task', extra='ignored')
assert headers == {
Expand Down Expand Up @@ -609,7 +609,7 @@ def test_proto2_to_proto1(self, monkeypatch):
'task_chain': ['a'], 'chord': 'ch'}
)
headers = {
'task_id': 'tid', 'retries': 1, 'eta': 'eta', 'expires': 'exp',
'id': 'tid', 'retries': 1, 'eta': 'eta', 'expires': 'exp',
'group': 'grp', 'timelimit': [1, 2], 'task': 't',
'extra': 'ignored'
}
Expand Down
2 changes: 1 addition & 1 deletion user_tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from django.dispatch import Signal

__version__ = '3.4.2'
__version__ = '3.4.3'


# This signal is emitted when a user task reaches any final state:
Expand Down
4 changes: 2 additions & 2 deletions user_tasks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def proto2_to_proto1(body, headers):
return new_body


def extract_proto2_headers(task_id, retries, eta, expires, group, timelimit, task, **_):
def extract_proto2_headers(id, retries, eta, expires, group, timelimit, task, **_): # pylint: disable=redefined-builtin
"""
Extract relevant headers from protocol v2 format.
"""
return {
"id": task_id,
"id": id,
"task": task,
"retries": retries,
"eta": eta,
Expand Down