pasalkarsachin1 commented on code in PR #24726:
URL: https://github.com/apache/airflow/pull/24726#discussion_r909625824
##########
airflow/providers/docker/operators/docker.py:
##########
@@ -317,18 +317,13 @@ def _run_image_with_mounts(
if self.retrieve_output:
return self._attempt_to_retrieve_result()
elif self.do_xcom_push:
- log_parameters = {
- 'container': self.container['Id'],
- 'stdout': True,
- 'stderr': True,
- 'stream': True,
- }
+ if len(log_lines) == 0:
+ return None
try:
if self.xcom_all:
- return [stringify(line).strip() for line in
self.cli.logs(**log_parameters)]
+ return [stringify(line).strip() for line in log_lines]
else:
- lines = [stringify(line).strip() for line in
self.cli.logs(**log_parameters, tail=1)]
- return lines[-1] if lines else None
+ return stringify(log_lines[-1]).strip()
Review Comment:
Fixed
##########
airflow/providers/docker/operators/docker.py:
##########
@@ -317,18 +317,13 @@ def _run_image_with_mounts(
if self.retrieve_output:
return self._attempt_to_retrieve_result()
elif self.do_xcom_push:
- log_parameters = {
- 'container': self.container['Id'],
- 'stdout': True,
- 'stderr': True,
- 'stream': True,
- }
+ if len(log_lines) == 0:
+ return None
try:
if self.xcom_all:
- return [stringify(line).strip() for line in
self.cli.logs(**log_parameters)]
+ return [stringify(line).strip() for line in log_lines]
Review Comment:
Fixed
--
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]