potiuk 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_r351271112
##########
File path: airflow/executors/local_executor.py
##########
@@ -210,22 +268,35 @@ def end(self):
self.executor.sync()
def start(self):
- self.manager = multiprocessing.Manager()
+ """Starts the executor"""
+ self.manager = Manager()
self.result_queue = self.manager.Queue()
self.workers = []
self.workers_used = 0
self.workers_active = 0
- self.impl = (LocalExecutor._UnlimitedParallelism(self) if
self.parallelism == 0
- else LocalExecutor._LimitedParallelism(self))
+ self.impl = (LocalExecutor.UnlimitedParallelism(self) if
self.parallelism == 0
+ else LocalExecutor.LimitedParallelism(self))
self.impl.start()
- def execute_async(self, key, command, queue=None, executor_config=None):
+ def execute_async(self, key: TaskInstanceKey,
+ command: CommandType,
+ _=None):
+ """Execute asynchronously."""
+ if not self.impl:
+ raise AirflowException("The executor should be started first.")
self.impl.execute_async(key=key, command=command)
def sync(self):
+ """
+ Sync will get called periodically by the heartbeat method.
+ """
self.impl.sync()
def end(self):
+ """
+ Ends the executor.
+ :return:
Review comment:
Yeah! It failed docs :(
----------------------------------------------------------------
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