brokenjacobs commented on a change in pull request #8287: [AIRFLOW-4363] Fix 
JSON encoding error
URL: https://github.com/apache/airflow/pull/8287#discussion_r409880823
 
 

 ##########
 File path: airflow/providers/docker/operators/docker.py
 ##########
 @@ -280,9 +279,10 @@ def execute(self, context):
         # Pull the docker image if `force_pull` is set or image does not exist 
locally
         if self.force_pull or not self.cli.images(name=self.image):
             self.log.info('Pulling docker image %s', self.image)
-            for line in self.cli.pull(self.image, stream=True, decode=True):
-                output = json.loads(line.decode('utf-8').strip())
-                if 'status' in output:
+            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:
 
 Review comment:
   Looks much better. Is there ever a case where cli.pull will return a str 
when called with decode=True?

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


With regards,
Apache Git Services

Reply via email to