dstandish commented on a change in pull request #13793:
URL: https://github.com/apache/airflow/pull/13793#discussion_r570708462
##########
File path: airflow/providers/docker/operators/docker.py
##########
@@ -269,14 +269,17 @@ def _run_image(self) -> Optional[str]:
# duplicated conditional logic because of expensive operation
ret = None
if self.do_xcom_push:
- ret = self.cli.logs(container=self.container['Id']) if
self.xcom_all else line.encode('utf-8')
+ if self.xcom_all:
+ ret = self.cli.logs(container=self.container['Id'])
+ else:
+ ret = self.cli.logs(container=self.container['Id'],
tail=1).strip()
if self.auto_remove:
self.cli.remove_container(self.container['Id'])
return ret
- def execute(self, context) -> Optional[str]:
+ def execute(self, context) -> Optional[bytes]:
Review comment:
should we perhaps decode utf-8 (assuming that's what comes out of logs,
so that we return a string type? sincere question... 🤔
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]