Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stop callingset_context, planned for 3.13 drop#8589

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@DavidCain
Copy link
Contributor

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 ofrequires_context.

Since this represents an API change, maybe it's best slated for 3.14?
(We could alternatively start raisingRemovedInDRF314Warning)

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 keepRemovedInDRF313Warning 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 afilterwarnings setup meant to
interceptrest_framework.RemovedInDRF313Warning, an error will be
thrown due to an unresolvable reference).

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`.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 describingthings which are to be deleted in 3.13, but I've opted to keep the (nowunreferenced) 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).
@lovelydinosaur
Copy link
Contributor

Since this represents an API change, maybe it's best slated for 3.14?

Great, yup. Well let's start working towards a 3.14 release then.

Thanks!

DavidCain reacted with thumbs up emoji

@lovelydinosaurlovelydinosaur merged commit8b2cccc intoencode:masterAug 8, 2022
@DavidCainDavidCain deleted the dcain-delete-set_context branchSeptember 21, 2022 17:41
DavidCain added a commit to DavidCain/django-rest-framework that referenced this pull requestSep 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 breakingchange:encode#8589
lovelydinosaur pushed a commit that referenced this pull requestSep 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 breakingchange:#8589
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull requestDec 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 wecan 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 describingthings which are to be deleted in 3.13, but I've opted to keep the (nowunreferenced) 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).
sigvef pushed a commit to sigvef/django-rest-framework that referenced this pull requestDec 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 breakingchange:encode#8589
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@DavidCain@lovelydinosaur

[8]ページ先頭

©2009-2025 Movatter.jp