Skip to content

Add retries and queue fields to result_extended (#513) - #514

Open
jheld wants to merge 2 commits into
celery:mainfrom
jheld:main
Open

Add retries and queue fields to result_extended (#513)#514
jheld wants to merge 2 commits into
celery:mainfrom
jheld:main

Conversation

@jheld

@jheld jheld commented Aug 27, 2026

Copy link
Copy Markdown

Fixes #513.

Support all fields in result_extended that celery's native database backend exposes. worker was already stored; this adds retries and queue.

  • Add queue and retries columns to TaskResult model (+ migration)
  • Populate them from the task request (request.retries, request.delivery_info['routing_key'])
  • Surface them in the admin
  • Tests

@auvipy
auvipy requested review from auvipy and a lite review from Copilot August 27, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends django-celery-results’ database backend “result_extended” support to include Celery’s queue and retries fields (in addition to the existing worker field), aligning stored task metadata with Celery’s native DB backend.

Changes:

  • Add queue and retries columns to TaskResult (plus migration) and expose them via TaskResult.as_dict().
  • Populate retries and queue from the task request in the database backend extended properties.
  • Surface queue/retries in the Django admin and add/adjust unit tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
t/unit/backends/test_database.py Adds assertions and a new test covering persistence/metadata for queue and retries.
django_celery_results/models.py Adds queue/retries fields to TaskResult and includes them in as_dict().
django_celery_results/migrations/0015_taskresult_retries_queue.py Introduces the schema migration for the new columns.
django_celery_results/managers.py Extends store_result() to accept/store queue and retries.
django_celery_results/backends/database.py Reads request.retries and request.delivery_info['routing_key'] into extended properties.
django_celery_results/admin.py Adds queue/retries to admin list display/filter/fieldsets.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread django_celery_results/managers.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support all fields in result_extended

3 participants