pierrejeambrun commented on code in PR #31852:
URL: https://github.com/apache/airflow/pull/31852#discussion_r1230023810


##########
airflow/www/views.py:
##########
@@ -3083,6 +3083,8 @@ class GraphForm(DateTimeWithNumRunsWithDagRunsForm):
         for ti in dag.get_task_instances(dttm, dttm):
             if ti.task_id not in task_instances:
                 task_instances[ti.task_id] = 
wwwutils.get_instance_with_map(ti, session)
+                # Need to add operator_name explicitly because it's not a 
column in task_instances model.
+                task_instances[ti.task_id]["operator_name"] = ti.operator_name

Review Comment:
   I think to avoid this we can replace the @property by an sqlalchemy 
`column_property`. (Would also allow filtering, and querying against it easily)



##########
airflow/www/views.py:
##########
@@ -3083,6 +3083,8 @@ class GraphForm(DateTimeWithNumRunsWithDagRunsForm):
         for ti in dag.get_task_instances(dttm, dttm):
             if ti.task_id not in task_instances:
                 task_instances[ti.task_id] = 
wwwutils.get_instance_with_map(ti, session)
+                # Need to add operator_name explicitly because it's not a 
column in task_instances model.
+                task_instances[ti.task_id]["operator_name"] = ti.operator_name

Review Comment:
   I think to avoid this we can replace the `@property` by an sqlalchemy 
`column_property`. (Would also allow filtering, and querying against it easily)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to