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



##########
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:
       @mingshi-wang if my provider package will define `sensor` decorator it 
will override the builtin one (will be returned in L34) - is this expected 
behaviour?  I wouldn't say so as this imposes some security risk in my opinion 
(I think I'm using airflow sensor but under the hood something else is being 
executed). 




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