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/11/03 16:28:09 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #12069: Deprecate adding Operators and Sensors via plugins

kaxil commented on a change in pull request #12069:
URL: https://github.com/apache/airflow/pull/12069#discussion_r516796551



##########
File path: airflow/plugins_manager.py
##########
@@ -40,11 +43,29 @@
 import_errors = {}
 
 
+PY37 = sys.version_info >= (3, 7)
+
+
 class AirflowPluginException(Exception):
     pass
 
 
-class AirflowPlugin(object):
+class _MetaPluginClass(type):
+    def __new__(cls, name, bases, props):
+        if props.get('operators', []) or props.get('sensors', []):
+            warnings.warn(
+                "Registering operator or sensors in plugins is deprecated -- these should be treated like "
+                "'plain' python modules, and imported normally in DAGs. Airflow 2.0 has removed the ability "
+                "to register these types in plugins",

Review comment:
       ```suggestion
                   "Registering operators or sensors in plugins is deprecated -- these should be treated like "
                   "'plain' python modules, and imported normally in DAGs. Airflow 2.0 has removed the ability "
                   "to register these types in plugins",
   ```
   
   Looks good for now, maybe we can link it to Module Management page once we backport that doc PR to v1-10-test https://airflow.readthedocs.io/en/latest/modules_management.html




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