You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/02/08 17:40:16 UTC

[GitHub] [airflow] jedcunningham commented on a change in pull request #21429: Fix docker behaviour with byte lines returned

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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org