-
-
Notifications
You must be signed in to change notification settings - Fork 953
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
refactor(Response): rename Response.body to Response.text #1764
Conversation
rename Response.body with Response.text. Response.body is now deprecated alias for Response.text fix falconry#1578
Codecov Report
@@ Coverage Diff @@
## master #1764 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 54 54
Lines 5127 5132 +5
Branches 816 816
=========================================
+ Hits 5127 5132 +5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. There may still be some body
mention lingering about though
While le issue did not mention HttpStatus
, I think that it should also rename body
-> text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We ought to also keep a couple of tests referencing the deprecated to property in order to make sure it continues to work as expected.
Furthermore, as you have correctly indicated in the PR checklist, Towcrier fragment(s) are still missing for the change.
@ashutoshvarma just checking if you might have a chance to continue working on this (by addressing @kgriffs and @CaselIT comments) within the next couple of weeks? |
No worries @ashutoshvarma, and thanks for the update. |
Hi @ashutoshvarma ! |
Otherwise if you are ok with it, we could take this to the finish line :) |
Terribly sorry for not fulfilling my commitment. |
Heh, no worries @ashutoshvarma ! @CaselIT would you like to take this over the finish line? |
(As I understand this was a limited Black Weekend offer that has now expired 😈 .) @maknop Yes, you are very welcome to take over if you still wish to! |
I may be able to work a bit on it this week |
A bit late, but I've managed to come around and finish this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good 👍
I could, however, grep
a couple of items that could be revised too:
docs/_newsfragments/1679.breakingchange.rst
docs/user/recipes/output-csv.rst
# Conflicts: # falcon/app.py # falcon/app_helpers.py # tests/test_httperror.py # tests/test_middleware.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Summary of Changes
This PR renames the
Response.body
toResponse.text
in both interfaces. AlsoResponse.body
is made deprecated alias for newResponse.text
Response.body
has been decorated withdeprecated(is_property=True)
. I was not sure about deprecation message, so I just wrote what came to my mind first.Response.body
are not removed fromtest_response_media_asgi.py
andtest_response_media.py
instead same test has been added forResponse.text
Related Issues
Fix #1578
Pull Request Checklist
This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!
If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.
docs/
.docs/
.versionadded
,versionchanged
, ordeprecated
directives.docs/_newsfragments/
, with the file name format{issue_number}.{fragment_type}.rst
. (Runtowncrier --draft
to ensure it renders correctly.)