Fokko closed pull request #3862: [AIRFLOW-1917] Remove extra newline character 
from log
URL: https://github.com/apache/incubator-airflow/pull/3862
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/utils/log/logging_mixin.py 
b/airflow/utils/log/logging_mixin.py
index 85bdcaad7a..442fecd036 100644
--- a/airflow/utils/log/logging_mixin.py
+++ b/airflow/utils/log/logging_mixin.py
@@ -92,7 +92,7 @@ def write(self, message):
             self._buffer += message
         else:
             self._buffer += message
-            self.logger.log(self.level, self._buffer)
+            self.logger.log(self.level, self._buffer.rstrip())
             self._buffer = str()
 
     def flush(self):
diff --git a/tests/utils/test_logging_mixin.py 
b/tests/utils/test_logging_mixin.py
index 74da742891..6d795584d9 100644
--- a/tests/utils/test_logging_mixin.py
+++ b/tests/utils/test_logging_mixin.py
@@ -86,8 +86,8 @@ def test_write(self):
 
         self.assertEqual(log._buffer, msg)
 
-        log.write("\n")
-        logger.log.assert_called_once_with(1, msg + "\n")
+        log.write(" \n")
+        logger.log.assert_called_once_with(1, msg)
 
         self.assertEqual(log._buffer, "")
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to