kacpermuda commented on code in PR #37075: URL: https://github.com/apache/airflow/pull/37075#discussion_r1484366520
########## docs/apache-airflow-providers/core-extensions/deprecations.rst: ########## @@ -0,0 +1,57 @@ + .. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + .. http://www.apache.org/licenses/LICENSE-2.0 + + .. Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + + +Deprecations +========================================== + +This is a summary of deprecated objects in Apache Airflow Providers Packages. + +.. note:: + At the moment we only show deprecations for classes, functions, methods, properties etc. + Support for an argument deprecation or an argument value deprecation will be added in the future. + + +.. important:: + Only deprecations made with @deprecated decorator are included in this docs. + If You use warnings.warn in function/method body it will not show up in this documentation. + Make sure to use @deprecated decorator as shown in the below example: Review Comment: @potiuk Yes, i believe we can standardize the way the deprecations are made. I like the idea of specific deprecation warnings, but, correct me if I'm wrong, if we put this new kind of Warning in the core Airflow ( f.e. `airflow/exceptions.py`) then the providers will not be able to use it unless they set the required minimum version of Airflow to f.e. 2.8.2 (the next one from now), which can never happen for some of them, therefore, it's going to be hard to rely on it in documentation? We can ofc try some try/except on import, but I'm not sure if it will solve the problem ? My idea for standarization of deprecations is to use decorators #36952 . We could define decorators like: @deprecated, @deprecated_args, @deprecated_arg_values like in tensorflow [codebase](https://github.com/tensorflow/tensorflow/blob/dec8e0b11f4f87693b67e125e67dfbc68d26c205/tensorflow/python/util/deprecation.py#L274), we could decorate the exact function/class it touches and possibly eliminate the need of using warnings.warn within the body. Anyway, maybe it will be good for this particular PR to remove this part of docs that we refer to here, and mark this doc as experimental or something similar? Then we can try to work on some rules, document (in the place You mentioned) and enforce them in a separate PR, f.e. the one i mentioned. Let me know what You think. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
