rich7420 commented on code in PR #56809:
URL: https://github.com/apache/airflow/pull/56809#discussion_r2450439185


##########
airflow-core/src/airflow/utils/log/log_reader.py:
##########
@@ -57,18 +57,20 @@ class TaskLogReader:
     @staticmethod
     def get_no_log_state_message(ti: TaskInstance | TaskInstanceHistory) -> 
Iterator[StructuredLogMessage]:
         """Yield standardized no-log messages for a given TI state."""
-        msg = {
-            TaskInstanceState.SKIPPED: "Task was skipped — no logs available.",
-            TaskInstanceState.UPSTREAM_FAILED: "Task did not run because 
upstream task(s) failed.",
-        }.get(ti.state, "No logs available for this task.")
+        if ti.state == TaskInstanceState.SKIPPED:
+            msg = "Task was skipped — no logs available."
+        elif ti.state == TaskInstanceState.UPSTREAM_FAILED:
+            msg = "Task did not run because upstream task(s) failed."
+        else:
+            msg = "No logs available for this task."
 
         yield StructuredLogMessage(
             timestamp=None,
             event="::group::Log message source details",
         )
         yield StructuredLogMessage(timestamp=None, event="::endgroup::")
         yield StructuredLogMessage(
-            timestamp=ti.updated_at or datetime.now(timezone.utc),
+            timestamp=cast("datetime | None", ti.updated_at) or 
datetime.now(timezone.utc),

Review Comment:
   yes, you're right! just removed it.



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