Skip to content

Allow users to write dag_id and task_id in their national characters, added display name for dag / task (v2) - #38446

Merged
ephraimbuddy merged 26 commits into
apache:mainfrom
jscheffl:fix-22073
Mar 27, 2024
Merged

Allow users to write dag_id and task_id in their national characters, added display name for dag / task (v2)#38446
ephraimbuddy merged 26 commits into
apache:mainfrom
jscheffl:fix-22073

Conversation

@jscheffl

@jscheffljscheffl commented Mar 25, 2024

Copy link
Copy Markdown
Contributor

This PR tries to continue the work from [ @aleksandr-shel @xgao1023 @uranusjr ] in PR #35320. It merges with current main. On top of this I fixed the bugs in pytest, some glitches in UI.

I'd LOVE to get this into 2.9.0 and as there were a couple of reviews already on the previous PR I hope it is not as compex as it looks. A lot of code is also due to the fact that I try to migrate all examples over to "nicer names". Sneak preview how it could look like after this PR:
image

What is open to be merged?

  • Review of course
  • Migrate the second half of example DAGs

closes: #22073
related: #32520, #28183

@boring-cyborgboring-cyborgBot added the provider:cncf-kubernetes Kubernetes (k8s) provider related issues label Mar 25, 2024
@jscheffljscheffl changed the title Fix 22073Allow users to write dag_id and task_id in their national characters, added display name for dag / task (v2)Mar 25, 2024
@jscheffljscheffl added the area:UI Related to UI/UX. For Frontend Developers. label Mar 25, 2024

@potiukpotiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the backend code and looked at the UI. Not sure if all the places in UI that should be updated, are but the backend implementation looks sound to me. I think some other pairs of eyes shold also look at that though.

@potiuk

Copy link
Copy Markdown
Member

The failing MINSQL ALchemy test here is fixed in #38445

Comment threadairflow/decorators/base.py Outdated
Comment threadairflow/models/baseoperator.py Outdated
@ephraimbuddyephraimbuddy added this to the Airflow 2.9.0 milestone Mar 25, 2024

@ephraimbuddyephraimbuddy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should modify a lot of example dags to add task_display_name on them

@jscheffl

Copy link
Copy Markdown
ContributorAuthor

I don't think we should modify a lot of example dags to add task_display_name on them

Okay, then before going into a debate I'll revert the adjustments in the example DAGs for most cases and leave this for future cleanup.
I#l like to consolidate a lot of examples though. I believe we have many many and maybe (after release of 2.9) it is time to think about consolidating them.

@uranusjr

Copy link
Copy Markdown
Member

We should add a couple of sections in the documentation about the fields. Not sure where tbh.

@jscheffl

Copy link
Copy Markdown
ContributorAuthor

We should add a couple of sections in the documentation about the fields. Not sure where tbh.

How can I interpret your "Should"?
a) Must be before approval+merge
b) Okay to merge but do it before release
c) would be nice sooner or later

@jscheffl

Copy link
Copy Markdown
ContributorAuthor

I hope (&pray) that I catched all errors now and pipeline turns green...

@potiuk

Copy link
Copy Markdown
Member

Looks good

@uranusjr

Copy link
Copy Markdown
Member

Docs can be added in a separate PR, but I would prefer to have it for the final release. (Don’t need to hit alphas though, docs don’t break things.)

Comment threadairflow/api_connexion/schemas/dag_schema.py Outdated
Comment threadairflow/models/mappedoperator.py Outdated
Comment threadairflow/models/taskmixin.py
@jscheffl
jscheffl requested a review from uranusjrMarch 27, 2024 00:21
Comment threadairflow/api_connexion/schemas/task_instance_schema.py Outdated
Comment threadairflow/models/baseoperator.py Outdated
Comment threadairflow/models/abstractoperator.py Outdated
@ephraimbuddy
ephraimbuddy merged commit 8c44bcb into apache:mainMar 27, 2024
@ephraimbuddyephraimbuddy added the type:new-feature Changelog: New Features label Mar 27, 2024
mathiaHT pushed a commit to mathiaHT/airflow that referenced this pull request Apr 4, 2024
… added display name for dag / task (v2) (apache#38446)
* Add display name in DAGs and tasks
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Aleksandr Shelukheev <shelukheev@gmail.com>
* Fix frontend issues
* Fix pytests
* Add DAG display tool tips
* Implement national language char display example oon two DAGs
* Review nit from other PR
* Fix WWW pytest on HTML code
* Review feedback, make task_display_name a property, not a field in mapped operator
* Review feedback, rename internal fields
* Small nit, optimize sorting on DAG home page with display name
* Review feedback
* Fix pytests in API plus review feedback on API
* Review feedback, extend schema, update apispecs and fix breadcrumb navigation
* nit, update page titles as well
* Fix pytests for extended API model
* Ensure mapped operator also provides a display string
* Ensure display field is only serialized if different from task id
* fix pytest for API
* Review feedback from TP
* Move labels down to base and mapped operator
* Move labels up to abstract operator
* Only one decorator is needed
---------
Co-authored-by: Vincent Gao <xgao1023@gmail.com>
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Aleksandr Shelukheev <shelukheev@gmail.com>
@jscheffl
jscheffl deleted the fix-22073 branch October 5, 2025 07:38
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UIRelated to UI/UX. For Frontend Developers.provider:cncf-kubernetesKubernetes (k8s) provider related issuestype:new-featureChangelog: New Features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

6 participants

@jscheffl@potiuk@uranusjr@ephraimbuddy@bbovenzi@xgao1023-old