-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Force to use Airflow Deprecation warnings categories on @deprecated
decorator
#39205
Conversation
4c37f06
to
2a7d641
Compare
@deprecated
decorator
Pityy we do not have a way to specify |
Personally I more for the In general import warnings
from airflow.exceptions import AirflowProviderDeprecationWarning
wrn = AirflowProviderDeprecationWarning("FooBar")
wrn.deprecated_provider_since = "42.0.1"
warnings.warn(wrn) But this one not supported by the decorators because it is expected to have message a string literal and category as a class, and also there is no point to set |
… decorator (#39205) * Force to use Airflow Deprecation warnings categories on @deprecated decorator * Catch warning in Experimental API test (cherry picked from commit c2ef1da)
… decorator (apache#39205) * Force to use Airflow Deprecation warnings categories on @deprecated decorator * Catch warning in Experimental API test
By default deprecations decorators use
DeprecationWarning
which might be not what we want to use in core and providers.This one is a bit more extended version of:
However it work only with decorators, from Deprecation or PEP-702
^ 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.