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 2021/12/29 00:35:45 UTC

[GitHub] [airflow] dstandish commented on a change in pull request #20530: Add sensor decorator

dstandish commented on a change in pull request #20530:
URL: https://github.com/apache/airflow/pull/20530#discussion_r776109537



##########
File path: airflow/decorators/__init__.py
##########
@@ -29,9 +30,11 @@ def __getattr__(self, name):
         if name.startswith("__"):
             raise AttributeError(f'{type(self).__name__} has no attribute {name!r}')
         decorators = ProvidersManager().taskflow_decorators
-        if name not in decorators:
-            raise AttributeError(f"task decorator {name!r} not found")
-        return decorators[name]
+        if name in decorators:
+            return decorators[name]
+        if name == "sensor":
+            return sensor

Review comment:
       @dimberman can you comment on whether this is a good approach or whether instead we should do multiple inheritance with mixins as is done with `@task.virtualenv`?  i lean towards supporting the approach taken here but interested if you want to advocate for the mixin approach




-- 
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: commits-unsubscribe@airflow.apache.org

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