Grub4K commented on code in PR #37347: URL: https://github.com/apache/airflow/pull/37347#discussion_r1585335537
########## airflow/utils/log/logging_mixin.py: ########## @@ -147,18 +147,27 @@ def supports_external_link(self) -> bool: # We have to ignore typing errors here because Python I/O classes are a mess, and they do not # have the same type hierarchy defined as the `typing.IO` - they violate Liskov Substitution Principle -# While it is ok to make your class derive from IOBase (and its good thing to do as they provide +# While it is ok to make your class derive from TextIOBase (and its good thing to do as they provide # base implementation for IO-implementing classes, it's impossible to make them work with # IO generics (and apparently it has not even been intended) # See more: https://giters.com/python/typeshed/issues/6077 -class StreamLogWriter(IOBase, IO[str]): # type: ignore[misc] +class StreamLogWriter(TextIOBase, IO[str]): # type: ignore[misc] Review Comment: I used `io.UnsupportedOperation`, which inherits from `OSError` but better describes exactly this case -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
