ashb commented on a change in pull request #10996:
URL: https://github.com/apache/airflow/pull/10996#discussion_r492166289



##########
File path: airflow/example_dags/example_bash_operator.py
##########
@@ -56,7 +56,7 @@
 for i in range(3):
     task = BashOperator(
         task_id='runme_' + str(i),
-        bash_command='echo "{{ task_instance_key_str }}" && sleep 1',
+        bash_command='echo "{{ task_instance_key_str }}" && sleep 60',

Review comment:
       I don't think you meant to commit this (and it'll probably slow down a 
number of tests as a result)

##########
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:
       Why do we need a method for this (over just a "plain" `executor.job_id = 
X`)?

##########
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:
       Does this actually need to be global? Even a class-level variable would 
be better than an actual global, but an instance property would be best still 
if that's possible -- like couldn't this be stored as a property of the 
KubernetesExecutor, say?

##########
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:
       Just make it a plain old property?




----------------------------------------------------------------
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]


Reply via email to