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

Deprecate body_bytes to merge into body #1739

Merged
merged 2 commits into from
Jun 28, 2020
Merged

Deprecate body_bytes to merge into body #1739

merged 2 commits into from
Jun 28, 2020

Conversation

LiraNuna
Copy link
Contributor

@LiraNuna LiraNuna commented Dec 24, 2019

As suggested in #1736 (comment), this PR deprecates body_bytes and merges it into body.

Please note that I have intentionally removed the body_bytes param completely to elicit discussion about how to properly deprecate it (cc @ahopkins who has some thoughts to share).

@codecov
Copy link

codecov bot commented Dec 24, 2019

Codecov Report

Merging #1739 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1739   +/-   ##
=======================================
  Coverage   92.18%   92.18%           
=======================================
  Files          22       22           
  Lines        2238     2238           
  Branches      419      419           
=======================================
  Hits         2063     2063           
  Misses        136      136           
  Partials       39       39

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc5925b...6fe26fc. Read the comment docs.

@Tronic
Copy link
Member

Tronic commented Dec 25, 2019

Check out #1674 as there is some overlap, in particular with how bytes vs. other types are detected.

@LiraNuna
Copy link
Contributor Author

Sure, I can upgrade body to bytes but that will keep the weirdness that is the two parameters merging into the same thing.

Here are the questions I have in a more blunt form:

  • How will the developer know to stop using body_bytes and to start using body?
  • When will body_bytes be removed?
  • What happens if both body and body_bytes are passed in?
  • And what's up with black adding comma to line 208?

@codecov
Copy link

codecov bot commented Jan 20, 2020

Codecov Report

Merging #1739 into master will increase coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1739      +/-   ##
==========================================
+ Coverage   91.52%   91.63%   +0.10%     
==========================================
  Files          27       27              
  Lines        2998     3000       +2     
  Branches      544      545       +1     
==========================================
+ Hits         2744     2749       +5     
+ Misses        174      172       -2     
+ Partials       80       79       -1     
Impacted Files Coverage Δ
sanic/response.py 98.08% <100.00%> (+0.02%) ⬆️
sanic/server.py 74.33% <0.00%> (+0.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b324ae...230e1e6. Read the comment docs.

@LiraNuna
Copy link
Contributor Author

LiraNuna commented Feb 4, 2020

@Tronic, my main questions are "is it okay to deprecate this parameter?" and "how will library users know to avoid code breakage?"

I'm assuming a version bump and a note in the CHANGELOG, but is it this PR's responsibility to do that?

I think this PR is ready to review assuming the param deprecation is wanted.

@ahopkins
Copy link
Member

ahopkins commented Feb 4, 2020

Sorry for not jumping in with thoughts sooner. I was sort of waiting for the new organizational structure to kick in and let there be a bit more of a formalized discussion about how to handle deprecations.

I would like to put this one on hold until that conversation takes place. I expect the Steering Council to be in place within the next week or two.

@Tronic
Copy link
Member

Tronic commented Mar 17, 2020

@ahopkins Any updates on that? I'd like to see this merged for 20.3.

@LiraNuna
Copy link
Contributor Author

LiraNuna commented May 3, 2020

What is stopping this PR from being merged? I'd love to get it over the finish line

Copy link
Member

@Tronic Tronic left a comment

Choose a reason for hiding this comment

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

As per new rules, I believe we will need a deprecation warning to anyone using body_bytes, and can only merge this one after a deprecation period in version 21.3. Could you make another PR for the warning, to be included in the upcoming 20.6 release?

@Tronic
Copy link
Member

Tronic commented Jun 21, 2020

Alternatively, modify this PR so that it still takes body_bytes arguments but gives a warning whenever those are used.

@LiraNuna
Copy link
Contributor Author

@Tronic how does this look? I chose to accept the old param so when the true deprecation comes, there are more options

Copy link
Member

@Tronic Tronic left a comment

Choose a reason for hiding this comment

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

Cool, thanks. I think this should be released in 20.6 and body_bytes removed in 21.3.

@ahopkins ahopkins merged commit 6239fa4 into sanic-org:master Jun 28, 2020
@LiraNuna LiraNuna deleted the refactor_out_body_bytes branch June 28, 2020 06:03
sangaline added a commit to sangaline/sanic-transmute that referenced this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants