You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a step number 2 of the process described in #36876, please refer to it for the rationale and in depth description. Possibly, it can also replace part of the mechanism described in #31830.
TLDR
See the tests i wrote, for the demo of how it works (look at the end of the file).
I want to add a decorator (for now only for classes, functions, methods etc.) that we can use for deprecations in the entire codebase (core and providers). By defining a custom function, we can have the most common information (now included in deprecation message) as separate arguments, so it's easier to parse it and use in CI, docs etc.
To do in next PRs
Possibly some changes in the documentation will be required, to describe how the developers should deprecate things and what are the options.
We can probably remove the warnings from current location (airflow.exceptions.py) and only keep them in airflow.deprecation.py, but this requires some time to migrate etc. so I am not sure how do properly do it.
Questions
This is my first PR that touches the core airflow, so let me know if anything needs to be changed 😄 I also have some questions to the functionality itself:
Are there any more arguments that we can define in the deprecation decorator? Some ideas?
Is it a good place (deprecation module in core) to have helper functions like: get_callable_full_path or validate_release_string. We can just make them private.
Should we define separate provider_deprecated decorator that will have a default category set to AirflowProviderDeprecationWarning ?
Should we allow passing a different Adapter, so that You can alter the deprecation message or we want to enforce standardization in the whole codebase and remove that option for the end user?
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.
This file contains hidden or 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
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.
Rationale
This is a step number 2 of the process described in #36876, please refer to it for the rationale and in depth description. Possibly, it can also replace part of the mechanism described in #31830.
TLDR
See the tests i wrote, for the demo of how it works (look at the end of the file).
I want to add a decorator (for now only for classes, functions, methods etc.) that we can use for deprecations in the entire codebase (core and providers). By defining a custom function, we can have the most common information (now included in deprecation message) as separate arguments, so it's easier to parse it and use in CI, docs etc.
To do in next PRs
airflow.exceptions.py) and only keep them inairflow.deprecation.py, but this requires some time to migrate etc. so I am not sure how do properly do it.Questions
This is my first PR that touches the core airflow, so let me know if anything needs to be changed 😄 I also have some questions to the functionality itself:
get_callable_full_pathorvalidate_release_string. We can just make them private.provider_deprecateddecorator that will have a default category set to AirflowProviderDeprecationWarning ?^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.