mingshi-wang commented on a change in pull request #20530:
URL: https://github.com/apache/airflow/pull/20530#discussion_r778380857
##########
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:
@turbaszek You are correct and this is a valid concern to me. A solution
I can think of is to raise an error in the ProviderManager if "sensor" is
registered by any provider. This makes "sensor" a reserved name but I would
like to hear you suggestion.
--
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]