aoen closed pull request #3955: [AIRFLOW-3121] Define closed property on 
StreamLogWriter
URL: https://github.com/apache/incubator-airflow/pull/3955
 
 
   

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 442fecd036..f3b490e6a3 100644
--- a/airflow/utils/log/logging_mixin.py
+++ b/airflow/utils/log/logging_mixin.py
@@ -68,6 +68,7 @@ def _set_context(self, context):
             set_context(self.log, context)
 
 
+# TODO: Formally inherit from io.IOBase
 class StreamLogWriter(object):
     encoding = False
 
@@ -83,6 +84,16 @@ def __init__(self, logger, level):
         self.level = level
         self._buffer = str()
 
+    @property
+    def closed(self):
+        """
+        Returns False to indicate that the stream is not closed (as it will be
+        open for the duration of Airflow's lifecycle).
+
+        For compatibility with the io.IOBase interface.
+        """
+        return False
+
     def write(self, message):
         """
         Do whatever it takes to actually log the specified logging record


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to