Skip to content

Conversation

@temaxuck
Copy link
Contributor

@temaxuck temaxuck commented Aug 15, 2025

Note: Before submitting this pull request, please review our contributing
guidelines
.

Description

Fix for #9864

@auvipy auvipy requested review from auvipy and Copilot August 16, 2025 05:16
@auvipy auvipy added this to the 5.6.0 milestone Aug 16, 2025

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Aug 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.62%. Comparing base (777d92f) to head (37e33e7).
⚠️ Report is 70 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9865      +/-   ##
==========================================
- Coverage   78.63%   78.62%   -0.01%     
==========================================
  Files         153      153              
  Lines       19198    19199       +1     
  Branches     2546     2546              
==========================================
  Hits        15096    15096              
  Misses       3807     3807              
- Partials      295      296       +1     
Flag Coverage Δ
unittests 78.60% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

can you also add some unit test for it?

@temaxuck
Copy link
Contributor Author

can you also add some unit test for it?

Added a few tests to ensure that CouchBackend works correctly with results.

To verify that celery actually works with the pycouchdb library, I had to mock the requests.session used under the hood by pycouchdb.resource.Resource. This mock, CouchSessionMock, emulates the actual CouchDB requests.

Please review carefully.

@auvipy
Copy link
Member

auvipy commented Aug 19, 2025

thanks

@auvipy auvipy requested a review from Copilot August 19, 2025 09:05
Copy link
Contributor

Copilot AI left a comment

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 fixes a TypeError in the CouchDB backend's delete() method where a bytes-like object was expected but a string was provided. The fix ensures proper type conversion before calling the underlying CouchDB delete operation.

  • Adds bytes_to_str conversion to the delete() method for consistency with other methods
  • Introduces comprehensive test coverage for CouchDB backend operations

Reviewed Changes

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

File Description
celery/backends/couchdb.py Fixes the delete method by adding bytes_to_str conversion
t/unit/backends/test_couchdb.py Adds comprehensive test suite with mock CouchDB session and full backend operation tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@temaxuck temaxuck changed the title Fix couchdb backend delete() method raises TypeError: a bytes-like object is required, not 'str' Fix AsyncResult.forget() with couchdb backend method raises TypeError: a bytes-like object is required, not 'str' Aug 19, 2025
@temaxuck temaxuck requested a review from auvipy August 19, 2025 11:22
@auvipy auvipy merged commit 31d05ed into celery:main Aug 26, 2025
108 checks passed
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.

3 participants