Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: return HTTPResponse from certain methods #53

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

bmario
Copy link
Member

@bmario bmario commented Aug 7, 2023

These methods are Document.save(), Document.delete(), and Document.copy().

Breaking change: Document.copy() does not return a Document anymore. You can use the ETag and fetch the document yourself. Rationale: For efficiency, retrieving the copied document automatically is a bad idea anyways, so returning the response instead does not seem to be an issue. If you need the document, use the ETag, which is a part of the response object, to retrieve it.

Closes #49

These methods are `Document.save()`, `Document.delete()`,
and `Document.copy()`.

Breaking change: `Document.copy()` does not return a `Document` anymore.
You can use the ETag and fetch the document yourself.

Fixes #49
@bmario bmario added the breaking The labeled PR introduces a breaking change. DO NOT label issues with this. label Aug 7, 2023
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Merging #53 (fe87e8b) into master (5a42ab9) will increase coverage by 0.04%.
Report is 9 commits behind head on master.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
+ Coverage   97.15%   97.19%   +0.04%     
==========================================
  Files          13       13              
  Lines         950      964      +14     
==========================================
+ Hits          923      937      +14     
  Misses         27       27              
Files Changed Coverage Δ
aiocouch/__init__.py 100.00% <100.00%> (ø)
aiocouch/document.py 91.01% <100.00%> (+0.20%) ⬆️
aiocouch/remote.py 96.89% <100.00%> (+0.08%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@adrienverge
Copy link
Contributor

Thanks a lot @bmario for tackling this. We briefly tested this pull request on Document.save() and we could access the HTTP code (201 vs. 202) from Python code, as asked in #49. Thanks again!

@bmario bmario merged commit ae34e93 into master Aug 25, 2023
46 checks passed
@bmario bmario deleted the feat-response-propagation branch August 25, 2023 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking The labeled PR introduces a breaking change. DO NOT label issues with this.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return 201 or 202 on Document.save()
2 participants