turbaszek commented on a change in pull request #12763:
URL: https://github.com/apache/airflow/pull/12763#discussion_r534522587



##########
File path: airflow/providers/docker/operators/docker.py
##########
@@ -282,13 +282,20 @@ def execute(self, context) -> Optional[str]:
             raise Exception("The 'cli' should be initialized before!")
 
         # Pull the docker image if `force_pull` is set or image does not exist 
locally
+        # pylint: disable=too-many-nested-blocks
         if self.force_pull or not self.cli.images(name=self.image):
             self.log.info('Pulling docker image %s', self.image)
+            latest_status = {}
             for output in self.cli.pull(self.image, stream=True, decode=True):
                 if isinstance(output, str):
                     self.log.info("%s", output)
                 if isinstance(output, dict) and 'status' in output:
-                    self.log.info("%s", output['status'])
+                    if 'id' in output:
+                        if latest_status.get(output['id']) != output['status']:
+                            self.log.info("%s: %s", output['id'], 
output['status'])
+                            latest_status[output['id']] = output['status']

Review comment:
       There's a chance that `latest_status.get(output.get("id")) != 
output["status"]` will also work 




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


Reply via email to