From 47f43ec7f32c1887f074ef2dbd88d27aa0c1d684 Mon Sep 17 00:00:00 2001 From: khalidmammadov Date: Mon, 4 Oct 2021 21:01:08 +0100 Subject: [PATCH] Remove repetitive call to get executor class from config --- airflow/jobs/base_job.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/airflow/jobs/base_job.py b/airflow/jobs/base_job.py index 745f248fc4da0..d2b604f38079d 100644 --- a/airflow/jobs/base_job.py +++ b/airflow/jobs/base_job.py @@ -96,10 +96,9 @@ class BaseJob(Base, LoggingMixin): def __init__(self, executor=None, heartrate=None, *args, **kwargs): self.hostname = get_hostname() if executor: + # Executor here is used for test suites. So they can inject it for testing self.executor = executor - self.executor_class = executor.__class__.__name__ - else: - self.executor_class = conf.get('core', 'EXECUTOR') + self.executor_class = self.executor.__class__.__name__ self.start_date = timezone.utcnow() self.latest_heartbeat = timezone.utcnow() if heartrate is not None: