uranusjr commented on code in PR #22832:
URL: https://github.com/apache/airflow/pull/22832#discussion_r848029595


##########
airflow/operators/dummy.py:
##########
@@ -15,23 +15,26 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-from airflow.models.baseoperator import BaseOperator
-from airflow.utils.context import Context
+"""This module is deprecated. Please use :mod:`airflow.operators.empty`."""
 
+import warnings
 
-class DummyOperator(BaseOperator):
-    """
-    Operator that does literally nothing. It can be used to group tasks in a
-    DAG.
+from airflow.operators.empty import EmptyOperator
 
-    The task is evaluated by the scheduler but never processed by the executor.
-    """
+warnings.warn(
+    "This module is deprecated. Please use `airflow.operators.empty`.",
+    DeprecationWarning,
+    stacklevel=2,
+)
 
-    ui_color = '#e8f7e4'
-    inherits_from_dummy_operator = True
 
-    def __init__(self, **kwargs) -> None:
-        super().__init__(**kwargs)
+class DummyOperator(EmptyOperator):
+    """This class is deprecated. Please use `airflow.operators.empty.Empty`."""
 
-    def execute(self, context: Context):
-        pass
+    def __init__(self, **kwargs):
+        warnings.warn(
+            """This class is deprecated. Please use 
`airflow.operators.empty.Empty`.""",

Review Comment:
   ```suggestion
               """This class is deprecated. Please use 
`airflow.operators.empty.EmptyOperator`.""",
   ```



##########
airflow/operators/dummy.py:
##########
@@ -15,23 +15,26 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-from airflow.models.baseoperator import BaseOperator
-from airflow.utils.context import Context
+"""This module is deprecated. Please use :mod:`airflow.operators.empty`."""
 
+import warnings
 
-class DummyOperator(BaseOperator):
-    """
-    Operator that does literally nothing. It can be used to group tasks in a
-    DAG.
+from airflow.operators.empty import EmptyOperator
 
-    The task is evaluated by the scheduler but never processed by the executor.
-    """
+warnings.warn(
+    "This module is deprecated. Please use `airflow.operators.empty`.",
+    DeprecationWarning,
+    stacklevel=2,
+)
 
-    ui_color = '#e8f7e4'
-    inherits_from_dummy_operator = True
 
-    def __init__(self, **kwargs) -> None:
-        super().__init__(**kwargs)
+class DummyOperator(EmptyOperator):
+    """This class is deprecated. Please use `airflow.operators.empty.Empty`."""

Review Comment:
   ```suggestion
       """This class is deprecated. Please use 
`airflow.operators.empty.EmptyOperator`."""
   ```



##########
tests/serialization/test_dag_serialization.py:
##########
@@ -1796,3 +1796,38 @@ def x(arg1, arg2, arg3):
         "op_kwargs": {"arg1": [1, 2, {"a": "b"}]},
         "retry_delay": timedelta(seconds=30),
     }
+
+
[email protected]("ignore::DeprecationWarning")

Review Comment:
   Instead of filtering these, we should add `pytest.warns` to ensure the 
deprecation warning is emitted.



##########
dev/provider_packages/prepare_provider_packages.py:
##########
@@ -2155,6 +2155,12 @@ def summarise_total_vs_bad_and_warnings(total: int, bad: 
int, warns: List[warnin
     ),
     ("SelectableGroups dict interface is deprecated. Use select.", "kombu"),
     ("The module cloudant is now deprecated. The replacement is ibmcloudant.", 
"cloudant"),
+    ("This module is deprecated. Please use `airflow.operators.empty`.", 
"dbt"),
+    ("This class is deprecated. Please use `airflow.operators.empty.Empty`.", 
"dbt"),
+    ("This class is deprecated. Please use `airflow.operators.empty.Empty`.", 
"jdbc"),
+    ("This class is deprecated. Please use `airflow.operators.empty.Empty`.", 
"azure"),
+    ("This class is deprecated. Please use `airflow.operators.empty.Empty`.", 
"qubole"),
+    ("This class is deprecated. Please use `airflow.operators.empty.Empty`.", 
"winrm"),

Review Comment:
   And these



-- 
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]

Reply via email to