You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/17 17:18:02 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #9348: Properly propagated warnings in operators

mik-laj commented on a change in pull request #9348:
URL: https://github.com/apache/airflow/pull/9348#discussion_r441703449



##########
File path: tests/test_utils/mock_operators.py
##########
@@ -166,3 +166,13 @@ class MockHiveOperator(HiveOperator):
     def __init__(self, *args, **kwargs):
         self.run = mock.MagicMock()
         super().__init__(*args, **kwargs)
+
+
+class DeprecatedOperator(BaseOperator):
+    @apply_defaults
+    def __init__(self, *args, **kwargs):
+        warnings.warn("This operator is deprecated.", DeprecationWarning, stacklevel=4)

Review comment:
       As we discussed on Slack. We should add an assertion that checks if the warning has a good file




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org