jscheffl commented on code in PR #45627:
URL: https://github.com/apache/airflow/pull/45627#discussion_r1922888888


##########
airflow/api_fastapi/core_api/datamodels/tasks.py:
##########
@@ -90,7 +79,7 @@ class TaskResponse(BaseModel):
     @classmethod
     def validate_model(cls, task: Any) -> Any:
         task.__dict__.update(
-            {"class_ref": _get_class_ref(task), "is_mapped": isinstance(task, 
MappedOperator)}
+            {"class_ref": _get_class_ref(task), "is_mapped": getattr(task, 
"_is_mapped", False)}

Review Comment:
   Having this check multiple times in the code looks like danger of 
consistency for people making copy&paste - and it is bit made with internal 
knowledge. Can we move this to a utility such that the check is consistent 
across the codebase?



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