airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Separate dag/task UI display name from dag / task id

Open EricGao888 opened this issue 3 years ago • 10 comments

Description

  • Enable users to use their national characters, which are usually non-ASCIIs as the display name of their dags / tasks.

Use case/motivation

  • At present, only ASCIIs are allowed for dag_id and task_id as shown in this comment.
  • However, in many cases, users would like to use their national characters for their dag_ids and task_ids, which apparently leads to some existing issues, related: #21127, #18010
  • Enabling non-ASCII dag_id / task_id would be a great idea to solve these issues as commented here
  • For a quick fix, maybe we could add a new optional field display_name for both dag and task.
  • Considering backward compatibility, dag_id or task_id will be used as UI display name if the field display_name is None.

UPDATE (by @potiuk):

  • any solution to this one should also include possibility of specifying names for dynamically mapped tasks (individually - per mapped index id)

Related issues

related: #21127 related: #18010 related: #23020

Are you willing to submit a PR?

  • [x] Yes I am willing to submit a PR!

Code of Conduct

EricGao888 avatar Mar 08 '22 08:03 EricGao888

I think it's a good feature to have. I hope someone would like to pick it up.

potiuk avatar Mar 08 '22 14:03 potiuk

IMHO it is much better (and simpler to implement) than allowing non-ASCII characters for IDs (which is an alternative way of implementing it).

potiuk avatar Mar 08 '22 14:03 potiuk

I think it's a good feature to have. I hope someone would like to pick it up.

I'd like to take a look into this : )

EricGao888 avatar Mar 08 '22 14:03 EricGao888

Separating task_id and task display name would allow to have several similar tasks showing the same name. This would be extremly useful in the context of hyperparameter optimisation.

HugoCornu avatar Jul 26 '22 16:07 HugoCornu

Sure.Anyone is free to submit PR s imeplementing it @HugoCornu - yourself including.

potiuk avatar Jul 28 '22 17:07 potiuk

@potiuk I am looking to make my first contribution to Airflow. Would it be okay if I work on this issue?

koroder avatar Aug 02 '22 10:08 koroder

@potiuk I am looking to make my first contribution to Airflow. Would it be okay if I work on this issue?

@koroder It's totally fine from my perspective. As currently I'm busy with another project. Thx.

EricGao888 avatar Aug 02 '22 10:08 EricGao888

@potiuk I am looking to make my first contribution to Airflow. Would it be okay if I work on this issue?

@koroder BTW, you may directly start from this PR if you'd like to. #22118

EricGao888 avatar Aug 02 '22 10:08 EricGao888

Awesome! This is really helpful - I will take it from here.

koroder avatar Aug 02 '22 10:08 koroder

Following up from the discussion in #23020 - this feature should also include naming of mapped tasks.

potiuk avatar Aug 04 '22 07:08 potiuk

Hi guys, I would like to take this issue

aleksandr-shel avatar Nov 20 '22 20:11 aleksandr-shel

Feel free.

potiuk avatar Nov 25 '22 22:11 potiuk

There is a pending PR https://github.com/apache/airflow/pull/27145 I think we are waiting for a dev list discussion on that

eladkal avatar Nov 25 '22 22:11 eladkal

I put up a pr, would someone be able to take a look, please? #28183

aleksandr-shel avatar Dec 14 '22 18:12 aleksandr-shel

I did. A LOT more needs to be done for that (and I would really like others to chime in there). The #28183 is just the beginning of what should happen in te PR if we are to go in this direction (details in comments in the PR - and I think this is also just beginning of the comments, there are probably more things that will have to be thought about in this PR that I have not yet thought about.

potiuk avatar Dec 30 '22 13:12 potiuk

Any more news on this? On top of the use cases listed, it could address the lack of support for changing a DAG name without wiping out its logs and dag_runs.

matthewblock avatar Apr 02 '23 19:04 matthewblock

Well. As all other issues here - likely if there is no changes, nobody works on it. But if you feel like it, you can. I can assign you - the whole history of the issue is there - one of the solutions were vetoed by one of the maintainers - you can read all in the history. Better solution that would solve the problems mentioned there would probably be accepted if someone works on it. Would you like to @matthewblock ?

potiuk avatar Apr 17 '23 18:04 potiuk

+1 on this! Would love to see a feature like this for DAGs that delegate a bunch of work to mapped tasks and have a clear identifier for the work that is being done in that particular dynamic mapped task.

To make this more general I think is also brilliant. I'd love to work on this but we'll see if I get the time...

alex-astronomer avatar Apr 26 '23 21:04 alex-astronomer

Well. As all other issues here - likely if there is no changes, nobody works on it. But if you feel like it, you can. I can assign you - the whole history of the issue is there - one of the solutions were vetoed by one of the maintainers - you can read all in the history. Better solution that would solve the problems mentioned there would probably be accepted if someone works on it. Would you like to @matthewblock ?

I'm not a contributor at the moment and unfortunately I won't have the bandwidth to do so in the short term.

matthewblock avatar Apr 27 '23 19:04 matthewblock

I created a new PR, it's based on the work from aleksandr-shel but removed slugifiying https://github.com/apache/airflow/pull/32520

xgao1023 avatar Jul 11 '23 10:07 xgao1023

do we have a timeline on this ? please update.

pnsvk avatar Mar 18 '24 11:03 pnsvk

@pnsvk the PR will be included as part of 2.9, which should be released within the next 1.5 weeks

cmarteepants avatar Mar 28 '24 15:03 cmarteepants