This is an automated email from the ASF dual-hosted git repository.
ash pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new e7eb449 Remove extra/needless deprecation warnings from
airflow.contrib module (#15065)
e7eb449 is described below
commit e7eb449c8b00453ab58181f5dc0d0e15e38d0e99
Author: Ash Berlin-Taylor <[email protected]>
AuthorDate: Mon Mar 29 11:57:56 2021 +0100
Remove extra/needless deprecation warnings from airflow.contrib module
(#15065)
If you have `from airflow.contrib.operators.emr_add_steps_operator
import EmrAddStepsOperator` line in your DAG file, you get three
warnings for this one line
```
/home/ash/airflow/dags/foo.py:3 DeprecationWarning: This module is
deprecated.
/home/ash/airflow/dags/foo.py:3 DeprecationWarning: This package is
deprecated. Please use `airflow.operators` or `airflow.providers.*.operators`.
/home/ash/airflow/dags/foo.py:3 DeprecationWarning: This module is
deprecated. Please use `airflow.providers.amazon.aws.operators.emr_add_steps`.
```
All but the last is not helpful.
---
airflow/contrib/__init__.py | 4 ----
airflow/contrib/operators/__init__.py | 8 --------
2 files changed, 12 deletions(-)
diff --git a/airflow/contrib/__init__.py b/airflow/contrib/__init__.py
index 3a89862..37bd67f 100644
--- a/airflow/contrib/__init__.py
+++ b/airflow/contrib/__init__.py
@@ -16,7 +16,3 @@
# specific language governing permissions and limitations
# under the License.
"""This package is deprecated."""
-
-import warnings
-
-warnings.warn("This module is deprecated.", DeprecationWarning, stacklevel=2)
diff --git a/airflow/contrib/operators/__init__.py
b/airflow/contrib/operators/__init__.py
index ad3fa4b..2041adb 100644
--- a/airflow/contrib/operators/__init__.py
+++ b/airflow/contrib/operators/__init__.py
@@ -17,11 +17,3 @@
# under the License.
#
"""This package is deprecated. Please use `airflow.operators` or
`airflow.providers.*.operators`."""
-
-import warnings
-
-warnings.warn(
- "This package is deprecated. Please use `airflow.operators` or
`airflow.providers.*.operators`.",
- DeprecationWarning,
- stacklevel=2,
-)