gopidesupavan commented on code in PR #42427:
URL: https://github.com/apache/airflow/pull/42427#discussion_r1778328172
##########
airflow/providers/cncf/kubernetes/operators/spark_kubernetes.py:
##########
@@ -161,8 +160,13 @@ 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())
+ name = (
+ self.name or self.template_body.get("spark", {}).get("metadata",
{}).get("name") or self.task_id
+ )
+
+ updated_name = add_unique_suffix(name=name, max_len=MAX_LABEL_LEN)
+
+ return re.sub(r"[^a-z0-9-]+", "-", updated_name.lower())
Review Comment:
Yes make sense 😄 updated now.
--
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]