Skip to content

Added Deprecation Warnings for CoreAPI #7519

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

Merged
merged 31 commits into from
Jun 13, 2023
Merged

Added Deprecation Warnings for CoreAPI #7519

merged 31 commits into from
Jun 13, 2023

Conversation

smithdc1
Copy link
Contributor

@smithdc1 smithdc1 commented Sep 4, 2020

Fixed #7007 -- CoreAPI deprecation not being raised

As per comments in the linked issue, this PR looks to add deprecation warnings for CoreAPI. Comments some time ago suggested this should form part of the 3.12 release.

I have:

  • Added warnings at where I think are the relevant points
  • Added a filter that suppresses all of these warnings from the existing test suite. This is based on a regex match of the warning message
  • Added deprecation tests to check that the warning is actually raised when those elements are used.

@smithdc1 smithdc1 force-pushed the coreapi branch 2 times, most recently from 322ef8c to 937e2d1 Compare September 4, 2020 22:01
@carltongibson carltongibson added this to the 3.12 Release milestone Sep 5, 2020
@carltongibson
Copy link
Collaborator

Super. Good work @smithdc1. Yes, it's time to add these I think. 👍

Copy link
Collaborator

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

Looks good. (Half wonder if we need to trigger the warnings in the paginator, for example, but I can't see that it hurts.)

@smithdc1
Copy link
Contributor Author

As this is now targeting the 3.13 release I've moved the warnings to target removal in 3.15. I've also rebased.

@johnthagen
Copy link
Contributor

johnthagen commented Oct 27, 2020

@carltongibson As someone helping maintain drf-yasg, which is still using coreapi.SchemaGenerator, do you know about how long it will be before DRF 3.13 is released (i.e. how much time we have to migrate away before warnings are thrown)?

Thanks.

@carltongibson
Copy link
Collaborator

Hi @johnthagen. I'd say a while. 😀

This was to go in 3.12, but didn't make it. That's OK. I originally meant to add the warnings around the 3.10 timescale. But bandwidth as ever.

If I were you I'd pull the few CoreAPI bits out separately so that you're not relying on them being in DRF at all.

The whole idea of SchemaGenerator, and attaching via the descriptor at schema was to decouple the schema generation from the rest of the framework.

If you moved those bits you need wholesale, they'd no longer be an issue. (It should just be a couple of classes no? 🤔)

@tomchristie tomchristie modified the milestones: 3.13 Release, 3.14 Jan 10, 2022
@stale
Copy link

stale bot commented Mar 25, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 25, 2022
@auvipy
Copy link
Member

auvipy commented Nov 29, 2022

@tfranzel are you going to handle this one? if not I will try to fix the conflict

@stale stale bot removed the stale label Nov 29, 2022
@tfranzel
Copy link
Member

@auvipy I will have a look later today.

@auvipy
Copy link
Member

auvipy commented Dec 2, 2022

I fixed the merge conflicts, might need to fix the lint errors as well, I want to know if removed in 3.15 is still right for this? or we should increment the version number?? If no I will check what else need to be adjusted to merge this over the next couple of weeks.

@auvipy auvipy self-assigned this Jun 12, 2023
Copy link
Member

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

merging this without the pre commit fixes. will fix them separately

@auvipy auvipy merged commit a16dbfd into encode:master Jun 13, 2023
auvipy added a commit that referenced this pull request Jun 17, 2023
* fix OpenAPIRenderer for timedelta

* added test for rendering openapi with timedelta

* fix OpenAPIRenderer for timedelta

* added test for rendering openapi with timedelta

* Removed usage of field.choices that triggered full table load (#8950)

Removed the `{{ field.choices|yesno:",disabled" }}` block because this triggers the loading of full database table worth of objects just to determine whether the multi-select widget should be set as disabled or not.

Since this "disabled" marking feature is not present in the normal select field, then I propose to remove it also from the multi-select.

* Added Deprecation Warnings for CoreAPI (#7519)

* Added Deprecation Warnings for CoreAPI

* Bumped removal to DRF315

* Update rest_framework/__init__.py

* Update rest_framework/filters.py

* Update rest_framework/filters.py

* Update tests/schemas/test_coreapi.py

* Update rest_framework/filters.py

* Update rest_framework/filters.py

* Update tests/schemas/test_coreapi.py

* Update tests/schemas/test_coreapi.py

* Update setup.cfg

* Update rest_framework/pagination.py

---------

Co-authored-by: Asif Saif Uddin <[email protected]>

* Update copy right timeline

* Fix NamespaceVersioning ignoring DEFAULT_VERSION on non-None namespaces (#7278)

* Fix the case where if the namespace is not None and there's no match,
  NamespaceVersioning always raises NotFound even if DEFAULT_VERSION
  is set or None is in ALLOWED_VERSIONS

* Add test cases

* fix OpenAPIRenderer for timedelta

* added test for rendering openapi with timedelta

* added testcase for rendering yaml with minvalidator for duration field (timedelta)

---------

Co-authored-by: Rizwan Shaikh <[email protected]>
Co-authored-by: Lenno Nagel <[email protected]>
Co-authored-by: David Smith <[email protected]>
Co-authored-by: Asif Saif Uddin <[email protected]>
Co-authored-by: Konstantin Kuchkov <[email protected]>
@smithdc1 smithdc1 deleted the coreapi branch November 26, 2023 22:11
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Oct 21, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Oct 21, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Nov 9, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Nov 9, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Nov 22, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Nov 22, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Nov 22, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Nov 22, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Nov 22, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Nov 22, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Nov 22, 2024
tomodachi94 added a commit to tomodachi94/nixpkgs that referenced this pull request Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CoreAPI schemas not raising RemovedInDRF317Warning
6 participants