ashb commented on a change in pull request #6596: [AIRFLOW-6004] Untangle 
Executors class to avoid cyclic imports
URL: https://github.com/apache/airflow/pull/6596#discussion_r353156998
 
 

 ##########
 File path: airflow/utils/dag_processing.py
 ##########
 @@ -724,26 +530,27 @@ class DagFileProcessorManager(LoggingMixin):
     """
 
     def __init__(self,
-                 dag_directory,
-                 file_paths,
-                 max_runs,
-                 processor_factory,
-                 processor_timeout,
-                 signal_conn,
-                 async_mode=True):
-        self._file_paths = file_paths
-        self._file_path_queue = []
-        self._dag_directory = dag_directory
-        self._max_runs = max_runs
-        self._processor_factory = processor_factory
-        self._signal_conn = signal_conn
-        self._async_mode = async_mode
+                 dag_directory: str,
+                 file_paths: List[str],
+                 max_runs: int,
+                 processor_factory: Callable[[str, List[Any]], 
AbstractDagFileProcessor],
+                 processor_timeout: timedelta,
+                 signal_conn: Connection,
+                 async_mode: bool = True):
+        self._file_paths: List[str] = file_paths
+        self._file_path_queue: List[str] = []
+        self._dag_directory: str = dag_directory
+        self._max_runs: int = max_runs
+        self._processor_factory: Callable[[str, List[Any]], 
AbstractDagFileProcessor] = processor_factory
+        self._signal_conn: Connection = signal_conn
+        self._async_mode: bool = async_mode
 
 Review comment:
   Style point that w should decide upon: In cases like this where th function 
arg is typed we don't also need to specify the type on the instance attribute - 
mypy will do that automatically.
   
   So this could be written as:
   
   ```
       def __init__(self:
                    dag_directory: str,
                    file_paths: List[str],
                    max_runs: int,
                    processor_factory: Callable[[str, List[Any]], 
AbstractDagFileProcessor],
                    processor_timeout: timedelta,
                    signal_conn: Connection,
                    async_mode: bool = True):
           self._file_paths file_paths
           self._file_path_queue: List[str] = []
           self._dag_directory = dag_directory
           self._max_runs = max_runs
           self._processor_factory = processor_factory
           self._signal_conn = signal_conn
           self._async_mode = async_mode
   ```
   
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to