dimberman commented on a change in pull request #10996:
URL: https://github.com/apache/airflow/pull/10996#discussion_r492295346
##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -318,7 +320,8 @@ def __init__(self,
self.kube_watcher = self._make_kube_watcher()
def _make_kube_watcher(self) -> KubernetesJobWatcher:
- resource_version = KubeResourceVersion.get_current_resource_version()
+ global global_resource_version # pylint: disable = global-statement
Review comment:
@ashb the hard art is the fact that the K8sExecutor is split across 3
separate classes. I can't figure out if a Singleton would be more or less
antipattern.
##########
File path: airflow/executors/base_executor.py
##########
@@ -63,6 +63,14 @@ def __init__(self, parallelism: int = PARALLELISM):
= OrderedDict()
self.running: Set[TaskInstanceKey] = set()
self.event_buffer: Dict[TaskInstanceKey, EventBufferValueType] = {}
+ self.job_id = None
+
+ def set_job_id(self, job_id):
+ """
+
+ @return:
+ """
+ self.job_id = job_id
Review comment:
So make this a setter function?
##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -318,7 +320,8 @@ def __init__(self,
self.kube_watcher = self._make_kube_watcher()
def _make_kube_watcher(self) -> KubernetesJobWatcher:
- resource_version = KubeResourceVersion.get_current_resource_version()
+ global global_resource_version # pylint: disable = global-statement
Review comment:
@ashb replaced with a Singleton
##########
File path: airflow/executors/base_executor.py
##########
@@ -63,6 +63,14 @@ def __init__(self, parallelism: int = PARALLELISM):
= OrderedDict()
self.running: Set[TaskInstanceKey] = set()
self.event_buffer: Dict[TaskInstanceKey, EventBufferValueType] = {}
+ self.job_id = None
+
+ def set_job_id(self, job_id):
+ """
+
+ @return:
+ """
+ self.job_id = job_id
Review comment:
@ashb already did :)
----------------------------------------------------------------
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]