-
Notifications
You must be signed in to change notification settings - Fork 170
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
To support task display_name #1278
base: main
Are you sure you want to change the base?
Conversation
❌ Deploy Preview for sunny-pastelito-5ecb04 failed.
|
Hi team, ( @tatiana @pankajkoti ) |
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.
HI @t0momi219, thank you very much for the detailed explanation of the problem and for proposing a fix.
I was surprised with the amount of lines changed to fix the issue. It feels like you tried to do two things at once: fix the problem while refactoring the code. Would it be possible to solve the bug with less changes to the code?
As an example, what if we:
- Introduced a function (e.g.
normalize_node_name
that takes anode_name
, normalizes it, handling non-ASCII characters) - Replaced the ocurrences of
node.name
bynormalize_node_name(node.name)
Hi @tatiana @pankajkoti , PR Changes
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1278 +/- ##
==========================================
+ Coverage 95.85% 96.03% +0.18%
==========================================
Files 67 67
Lines 3976 3985 +9
==========================================
+ Hits 3811 3827 +16
+ Misses 165 158 -7 ☔ View full report in Codecov by Sentry. |
Hi @tatiana, @pankajkoti I am also working on the following PR, and I plan to modify the same generate_task_or_group function in both: #1317 Therefore, I’d like to complete this PR first before moving on to the next PR’s changes. If possible, could you please review this PR again? I believe I’ve completed the code adjustments. If there are still any issues, please let me know. Thank you, and I apologize if further modifications are needed. |
Description
When running models that have names containing multibyte characters, runtime errors occur in Airflow environments where statsd is enabled (e.g., MWAA uses this statsd metric for collecting metrics in Cloudwatch).
Related Issue: apache/airflow#18010
To address this, Airflow 2.9 introduced the ability to render tasks using display_name, which allows task names to be rendered separately from their task_id.
Reference: https://airflow.apache.org/docs/apache-airflow/stable/_modules/airflow/example_dags/example_display_name.html
This PR adds support for display_name, enabling users who use non-ASCII characters as their native language to display task names in their own language, even in environments like MWAA.
Details
The normalize_task_id parameter is added to RenderConfig.
This option accepts a function to generate a task ID from a node. This allows users to generate arbitrary task IDs from models. If a function is passed to this option, Cosmos will use the model name as the display_name for tasks while rendering them.
Related Issue(s)
closes #1277
Breaking Change?
Checklist