-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Stop calling set_context
, planned for 3.13 drop
#8589
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Per the deprecation warnings (which have been raised since DRF 3.11), `set_context()` was planned not to be supported in DRF 3.13. I think we can safely delete it, in favor of `requires_context`. From the 3.11 announcement: > Previous our approach to this was that implementations could include a > `set_context` method, which would be called prior to validation. However > this approach had issues with potential race conditions. We have now > move this approach into a pending deprecation state. It will continue to > function, but will be escalated to a deprecated state in 3.12, and > removed entirely in 3.13. Why keep `RemovedInDRF313Warning` around? ========================================= It's a bit odd that version 3.13 includes an exception class describing things which are to be deleted in 3.13, but I've opted to keep the (now unreferenced) class around, for fear of breaking others' setup. (For example, if projects have a `filterwarnings` setup meant to intercept `rest_framework.RemovedInDRF313Warning`, an error will be thrown due to an unresolvable reference).
Great, yup. Well let's start working towards a 3.14 release then. Thanks! |
DavidCain
added a commit
to DavidCain/django-rest-framework
that referenced
this pull request
Sep 21, 2022
When DRF 3.14 is released, these exception classes will be meaningless, so we can delete them (this has always been done). A previous PR removed the last incidence of `RemovedInDRF313Warning`, but didn't outright delete the class for fear of shipping a breaking change: encode#8589
tomchristie
pushed a commit
that referenced
this pull request
Sep 22, 2022
When DRF 3.14 is released, these exception classes will be meaningless, so we can delete them (this has always been done). A previous PR removed the last incidence of `RemovedInDRF313Warning`, but didn't outright delete the class for fear of shipping a breaking change: #8589
sigvef
pushed a commit
to sigvef/django-rest-framework
that referenced
this pull request
Dec 3, 2022
Per the deprecation warnings (which have been raised since DRF 3.11), `set_context()` was planned not to be supported in DRF 3.13. I think we can safely delete it, in favor of `requires_context`. From the 3.11 announcement: > Previous our approach to this was that implementations could include a > `set_context` method, which would be called prior to validation. However > this approach had issues with potential race conditions. We have now > move this approach into a pending deprecation state. It will continue to > function, but will be escalated to a deprecated state in 3.12, and > removed entirely in 3.13. Why keep `RemovedInDRF313Warning` around? ========================================= It's a bit odd that version 3.13 includes an exception class describing things which are to be deleted in 3.13, but I've opted to keep the (now unreferenced) class around, for fear of breaking others' setup. (For example, if projects have a `filterwarnings` setup meant to intercept `rest_framework.RemovedInDRF313Warning`, an error will be thrown due to an unresolvable reference).
sigvef
pushed a commit
to sigvef/django-rest-framework
that referenced
this pull request
Dec 3, 2022
When DRF 3.14 is released, these exception classes will be meaningless, so we can delete them (this has always been done). A previous PR removed the last incidence of `RemovedInDRF313Warning`, but didn't outright delete the class for fear of shipping a breaking change: encode#8589
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per the deprecation warnings (which have been raised since DRF 3.11),
set_context()
was planned not to be supported in DRF 3.13. I think wecan safely delete it, in favor of
requires_context
.Since this represents an API change, maybe it's best slated for 3.14?
(We could alternatively start raising
RemovedInDRF314Warning
)From the 3.11 announcement:
Why keep
RemovedInDRF313Warning
around?It's a bit odd that version 3.13 includes an exception class describing
things which are to be deleted in 3.13, but I've opted to keep the (now
unreferenced) class around, for fear of breaking others' setup.
(For example, if projects have a
filterwarnings
setup meant tointercept
rest_framework.RemovedInDRF313Warning
, an error will bethrown due to an unresolvable reference).