jedcunningham commented on a change in pull request #21429:
URL: https://github.com/apache/airflow/pull/21429#discussion_r801895338



##########
File path: airflow/providers/docker/operators/docker.py
##########
@@ -302,12 +310,12 @@ def _run_image_with_mounts(self, target_mounts, 
add_tmp_variable: bool) -> Optio
                     'stderr': True,
                     'stream': True,
                 }
-
-                return (
-                    self.cli.logs(**log_parameters)
-                    if self.xcom_all
-                    else self.cli.logs(**log_parameters, tail=1)
-                )
+                if self.xcom_all:
+                    return [stringify(line).strip() for line in 
self.cli.logs(**log_parameters)]
+                else:
+                    lines = [stringify(line).strip() for line in 
self.cli.logs(**log_parameters, tail=1)]

Review comment:
       ```suggestion
   
                   lines = [stringify(line).strip() for line in 
self.cli.logs(**log_parameters, tail=1)]
   ```
   
   nit: we short circuit anyways, and I think this is easier to grok.




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