gopidesupavan commented on code in PR #42427:
URL: https://github.com/apache/airflow/pull/42427#discussion_r1773738642


##########
airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py:
##########
@@ -161,8 +160,25 @@ def manage_template_specs(self):
         return template_body
 
     def create_job_name(self):
-        initial_name = add_unique_suffix(name=self.task_id, 
max_len=MAX_LABEL_LEN)
-        return re.sub(r"[^a-z0-9-]+", "-", initial_name.lower())
+        """
+        Spark name is created based on the following order of precedence.
+
+        Check the name argument in the operator parameters.
+        Check the name specified in the YAML file.
+        If neither is available, use the task ID as the name.
+
+        It adds default random id characters for the name provided suffix.
+        """
+        name = self.template_body.get("spark", {}).get("metadata", 
{}).get("name")

Review Comment:
   slightly changed to single line statement hope it make sense :)?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to