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_r353151215
 
 

 ##########
 File path: airflow/executors/dask_executor.py
 ##########
 @@ -66,20 +63,17 @@ def execute_async(self,
                       command: CommandType,
                       queue: Optional[str] = None,
                       executor_config: Optional[Any] = None) -> None:
-        if not self.futures:
-            raise AirflowException("Executor should be started first.")
+        assert self.futures, NOT_STARTED_MESSAGE
 
 Review comment:
   I think this is a good case for asserts.
   
   Under normal circumstances they should pass, and it's only if you're 
developing really that you might get this wrong, so having this be asserts that 
could be disabled by `python -O` seems like the right thing to do.

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