uranusjr commented on code in PR #38907:
URL: https://github.com/apache/airflow/pull/38907#discussion_r1560429399


##########
airflow/models/taskinstance.py:
##########
@@ -539,7 +539,11 @@ def _refresh_from_db(
         task_instance.end_date = ti.end_date
         task_instance.duration = ti.duration
         task_instance.state = ti.state
-        task_instance.try_number = ti._try_number  # private attr to get value 
unaltered by accessor
+        try:
+            task_instance.try_number = ti._try_number  # private attr to get 
value unaltered by accessor
+        except AttributeError:
+            task_instance.try_number = ti.try_number  # the 
TaskInstancePydantic case

Review Comment:
   Maybe we should make `_try_number` an alias (property) on 
TaskInstancePydantic instead? This seems too problematic.



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