-
Notifications
You must be signed in to change notification settings - Fork 16.4k
allows users to write dag_id and task_id in their national characters, added display name for dag / task #28183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
|
I like how the implementation is started (and I think this one is needed). Particularly, I like it's going to be 100% backwards compatible and will only impact new DAGs with new DAG_IDs. I know however that there are people who have rather strong opinion on the subject so I will leave it for others to comment @ashb @uranusjr @dstandish @eladkal - I think it would be good to get your comments here. And I would like to get more comments, before we decide to progress with this idea because there are a LOT more to be done in this PR in order to be approved. But if we do, the more changes needed are I believe:
All those should have comprehensive unit tests covering all the edge cases there before we approve it anyway. |
|
I like the general direction this takes. The only part I don’t like is it silently slugifies the IDs. This does create some backward incompatibility issues (can be eliminated if we only slugify if the ID is not valid as-is), but more importantly, can result in som weird usability issues, such as ID conflicts when there are no actually conflicting IDs (because the slugified IDs conflict). This could be improved by improving error messages to report the original (user-supplied) value instead of the slugified one. Another further issue with this is it won’t be possible for the user to work around this slugified ID conflict. One possible solution would be to make the API more explicit, such as: # This would generate an auto slugified ID.
DAG(dag_name="いろはにほへと")
# But I can supply my own ID.
DAG(dag_name="いろはにほへと", dag_id="my_dag")
# This automatically sets the display name to the same as the ID,
# and still adheres to the current ID rules.
DAG(dag_id="my_dag") |
ashb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only part I don’t like is it silently slugifies the IDs
Agreed. And for that reason I am vetoing the PR as it stands
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
|
Is slugifying the IDs the only concern? If so I will be happy to remove that part - task/dag ID should just work as before - either explicitly provided or from the function name of task flow. I will be happy to continue the work if it makes sense. |
• this commit allows users to write dag_id and task_id in their national characters, which are usually non-ASCIIs as the display names of their dags.
• dag_id and task_id will be modified to ASCII version with the usage of slugify and stored in dag_id or task_id fields of dag and task
• unmodified version (possibly non-ASCII) of dag_id and task_id will be stored in display_name fields of dag and task
• related: #22073