-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
[Webserver] Use operator_name instead of task_type in UI #31662
Conversation
Found one more instance of |
@uranusjr While going through the code I found there are two other tooltips where we show the operator name
and
Ideally, both of them should show values derived from airflow/airflow/models/taskinstance.py Line 888 in 29d2a31
since However, this change can be a separate PR. WDYT? |
Hmm, yeah adding a new field is probably the simplest approach. Can you find other uses of Either way, I think we should hold this PR as-is and continue looking into |
@@ -3084,6 +3084,7 @@ class GraphForm(DateTimeWithNumRunsWithDagRunsForm): | |||
t.task_id: { | |||
"dag_id": t.dag_id, | |||
"task_type": t.task_type, |
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.
Do we still need this? If the only use case if to check SubDagOperator, we can use operator_name as well.
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.
Yes, I think we still need this since the below code compares the operator class name and it's best to keep this since the operato_name can change.
airflow/airflow/www/static/js/graph.js
Line 211 in 8891c69
isSubDag: task.task_type === "SubDagOperator", |
and based on that displaying the subdag button -
airflow/airflow/www/static/js/callModal.js
Lines 185 to 190 in 8891c69
if (isSubDag) { | |
$("#div_btn_subdag").show(); | |
subDagId = `${dagId}.${taskId}`; | |
} else { | |
$("#div_btn_subdag").hide(); | |
} |
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.
Wouldn't it be better to pass is_subdag
from the webserver instead? That's what we do in the REST API
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.
@bbovenzi Would it make sense to raise a separate PR for this change? because I think it's a separate task.
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.
Yeah, let's do a separate PR.
@uranusjr I checked for the usage of airflow/airflow/models/dagrun.py Line 1126 in 8891c69
Line 1749 in 8891c69
airflow/airflow/jobs/scheduler_job_runner.py Line 744 in 8891c69
I think adding another field to |
Yes that’s probably best. I think some of the use cases can technically switch to |
@uranusjr Added a new property Also, would be nice if you can cross verify all the places that should be populating the value for |
@uranusjr since there is a new field added to |
We have alembic. You can see the docs about addin new migrations (look for alembic) and you can also take a look at past prs that added migrations to |
149a8c9
to
3a4b580
Compare
7ef85bd
to
c3818f1
Compare
@@ -3084,6 +3084,7 @@ class GraphForm(DateTimeWithNumRunsWithDagRunsForm): | |||
t.task_id: { | |||
"dag_id": t.dag_id, | |||
"task_type": t.task_type, |
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.
Yeah, let's do a separate PR.
we should use
operator_name
when displaying operator name in UI.Related: #28466 (not closing yet, see discussion below)