Skip to content

Commit

Permalink
Change remove to pop in DebugExecutor (#8073)
Browse files Browse the repository at this point in the history
Due to difference in types between v1.10 and master
we have to change set.remove to dict.pop method

(cherry picked from commit 7393e3b693f06c81ec2d6fb818600b48146252f1)
  • Loading branch information
turbaszek authored and kaxil committed Apr 2, 2020
1 parent 895edc1 commit 5e7d5f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion airflow/executors/debug_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,5 @@ def terminate(self):

def change_state(self, key, state):
self.log.debug("Popping %s from executor task queue.", key)
self.running.remove(key)
self.running.pop(key)
self.event_buffer[key] = state
4 changes: 2 additions & 2 deletions tests/executors/test_debug_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_run_task(self, task_instance_mock):
task_instance_mock.job_id = job_id

executor = DebugExecutor()
executor.running = set([ti_key])
executor.running = {ti_key: task_instance_mock}
succeeded = executor._run_task(task_instance_mock)

assert succeeded
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_end(self):

executor = DebugExecutor()
executor.tasks_to_run = [ti]
executor.running = set([ti.key])
executor.running = {ti.key: mock.MagicMock}
executor.end()

ti.set_state.assert_called_once_with(State.UPSTREAM_FAILED)
Expand Down

0 comments on commit 5e7d5f1

Please sign in to comment.