Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for stamping by copying stamp values into the task result meta, following the approach used by Celery's base backend.
- Adds a new skipped unit test to verify stamping support.
- Updates the DatabaseBackend's meta extraction function to incorporate stamps and stamped headers into the task metadata.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| t/unit/backends/test_database.py | Adds a unit test for stamping support (currently skipped). |
| django_celery_results/backends/database.py | Updates metadata extraction to incorporate stamping data. |
Comments suppressed due to low confidence (1)
t/unit/backends/test_database.py:553
- The test for stamped headers is currently skipped. Consider investigating an approach to inject stamped headers into the request so that stamping support is actively validated.
@pytest.mark.skip("Need to find how to inject stamped headers")
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| tr = TaskResult.objects.get(task_id=tid2) | ||
| assert json.loads(tr.meta) == {'key': 'value', 'children': []} | ||
|
|
||
| @pytest.mark.skip("Need to find how to inject stamped headers") |
There was a problem hiding this comment.
mmmm.... not sure if we should merge this with this test only.... should we wait bit more?
There was a problem hiding this comment.
Yeah I agree this needs testing - I just couldn't work out how to actually go about setting the stamp on the request
There was a problem hiding this comment.
were you able to figure that out?
There was a problem hiding this comment.
No I didn't, I don't know enough about how the test helpers work in this project to figure out where it needs to be set
Fixes #480
Adds support for stamping by copying stamps into the result meta. This is the same approach Celery's base backend takes.
I wrote a test but it's currently marked as skipped, as I couldn't figure out how to set the stamps on the request. You can't set them directly on the
Requestobject and I wasn't sure if I could pass something into the_create_requesthelper to set them.