potiuk commented on a change in pull request #7191: [AIRFLOW-4030] second 
attempt to add singularity to airflow
URL: https://github.com/apache/airflow/pull/7191#discussion_r380544005
 
 

 ##########
 File path: airflow/providers/singularity/operators/__init__.py
 ##########
 @@ -0,0 +1,172 @@
+#
 
 Review comment:
   We should avoid adding code in `__init__.py` . Each operator should have 
their own file. Adding code to `__init__.py` causes the side effect that the 
code is imported and the imports are further processed when the package is 
imported. This is very bad as it is implicit behavior not expected by the one 
who imports it and it causes all the various problems with chaining loading of 
unnecessary imports which slows down application startup. We are just now 
voting in the devlist on removal of `airflow.__init__.py` as this is very bad 
example on how things should not be done.
   
   Please move it to separate class - this should also solve the problem with 
documentation building. One of the side effects of adding imports to 
__init__.py is tha the imported AirflowException class is now defined in two 
places. 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to