Add retries and queue fields to result_extended (#513) - #514
Open
jheld wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
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
queueandretriescolumns toTaskResult(plus migration) and expose them viaTaskResult.as_dict(). - Populate
retriesandqueuefrom the task request in the database backend extended properties. - Surface
queue/retriesin 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #513.
Support all fields in
result_extendedthat celery's native database backend exposes.workerwas already stored; this addsretriesandqueue.queueandretriescolumns toTaskResultmodel (+ migration)request.retries,request.delivery_info['routing_key'])