ferruzzi commented on code in PR #42808:
URL: https://github.com/apache/airflow/pull/42808#discussion_r1794408139


##########
airflow/api_connexion/schemas/task_instance_schema.py:
##########
@@ -69,22 +68,17 @@ class Meta:
     executor = auto_field()
     executor_config = auto_field()
     note = auto_field()
-    sla_miss = fields.Nested(SlaMissSchema, dump_default=None)
     rendered_map_index = auto_field()
     rendered_fields = JsonObjectField(dump_default={})
     trigger = fields.Nested(TriggerSchema)
     triggerer_job = fields.Nested(JobSchema)
 
     def get_attribute(self, obj, attr, default):
-        if attr == "sla_miss":
-            # Object is a tuple of task_instance and slamiss
-            # and the get_value expects a dict with key, value
-            # corresponding to the attr.
-            slamiss_instance = {"sla_miss": obj[1]}
-            return get_value(slamiss_instance, attr, default)
-        elif attr == "rendered_fields":
-            return get_value(obj[0], 
"rendered_task_instance_fields.rendered_fields", default)
-        return get_value(obj[0], attr, default)
+        ti = obj if isinstance(obj, TaskInstance) else obj[0]

Review Comment:
   Wasn't actually that bad.   That should be all of them.  Anything else I'll 
have to sort out tomorrow.



-- 
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