o-nikolas commented on code in PR #63476:
URL: https://github.com/apache/airflow/pull/63476#discussion_r2928001989


##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/batch_client.py:
##########
@@ -476,8 +476,19 @@ def get_job_all_awslogs_info(self, job_id: str) -> 
list[dict[str, str]]:
                 p.get("container", {}).get("logConfiguration", {})
                 for p in job_node_properties.get("nodeRangeProperties", {})
             ]
-            # one stream name per attempt
-            stream_names = [a.get("container", {}).get("logStreamName") for a 
in job_desc.get("attempts", [])]
+            # one stream name per attempt — handles both single-node and 
multi-node schemas
+            stream_names = []
+            for attempt in job_desc.get("attempts", []):
+                # Single-node: attempts[].container.logStreamName
+                container_stream = attempt.get("container", 
{}).get("logStreamName")
+                if container_stream:
+                    stream_names.append(container_stream)

Review Comment:
   Feels more natural to just continue here, no? The below for loop will not 
get anything to iterate over but feels odd to let it attempt even thought we 
already found a match.



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