mik-laj commented on a change in pull request #6389: [AIRFLOW-5663]: Switch to 
real-time logging in PythonVirtualenvOperator.
URL: https://github.com/apache/airflow/pull/6389#discussion_r339056635
 
 

 ##########
 File path: airflow/operators/python_operator.py
 ##########
 @@ -330,16 +330,20 @@ def _pass_op_args(self):
         return len(self.op_args) + len(self.op_kwargs) > 0
 
     def _execute_in_subprocess(self, cmd):
-        try:
-            self.log.info("Executing cmd\n%s", cmd)
-            output = subprocess.check_output(cmd,
-                                             stderr=subprocess.STDOUT,
-                                             close_fds=True)
-            if output:
-                self.log.info("Got output\n%s", output)
-        except subprocess.CalledProcessError as e:
-            self.log.info("Got error output\n%s", e.output)
-            raise
+        self.log.info("Executing cmd\n{}".format(cmd))
+        self._sp = subprocess.Popen(cmd,
+                                    stdout=subprocess.PIPE,
+                                    stderr=subprocess.STDOUT,
+                                    bufsize=0,
+                                    close_fds=True)
+        self.log.info("Got output\n")
 
 Review comment:
   ```suggestion
           self.log.info("Got output")
   ```
   Each log message is printed in a separated line.

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