XD-DENG commented on a change in pull request #12763:
URL: https://github.com/apache/airflow/pull/12763#discussion_r535470671



##########
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:
       Actually we already cannot avoid having to apply 
`disable=too-many-nested-blocks`, but your suggestion above is definitely fair.
   
   Have addressed it in 
https://github.com/apache/airflow/pull/12763/commits/23e81de0b7170d6132b183319bcd73729e508a52
 (with extremely minor change)




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