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_r352301019
##########
File path: airflow/executors/base_executor.py
##########
@@ -132,47 +151,64 @@ def heartbeat(self):
self.log.debug("Calling the %s sync method", self.__class__)
self.sync()
- def trigger_tasks(self, open_slots):
+ def trigger_tasks(self, open_slots: int) -> None:
"""
- Trigger tasks
+ Triggers tasks
:param open_slots: Number of open slots
- :return:
"""
sorted_queue = sorted(
[(k, v) for k, v in self.queued_tasks.items()],
key=lambda x: x[1][1],
reverse=True)
for _ in range(min((open_slots, len(self.queued_tasks)))):
- key, (command, _, queue, simple_ti) = sorted_queue.pop(0)
+ key, (command, _, _, simple_ti) = sorted_queue.pop(0)
self.queued_tasks.pop(key)
- self.running[key] = command
+ self.running.add(key)
self.execute_async(key=key,
command=command,
- queue=queue,
Review comment:
It is a change. i can revert that if you think it makes sense, but I found
that no of the executors is using it.
Even if someone is adding their own executors, they cannot just "add it"
because executors are not plugins. They would have to change the code of
Airflow to add it. We actually work with someone who actually added a new
executor (useful for debugging) and we are going to help to contribute it to
the code and one part of it is to make sure that what they did for 1.10.3 can
be implemented (and possibly contributed back) to 2.0.0 - and they realise
there might be incompatible changes.
----------------------------------------------------------------
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