michalc commented on code in PR #31855:
URL: https://github.com/apache/airflow/pull/31855#discussion_r1227554992


##########
airflow/utils/log/file_task_handler.py:
##########
@@ -147,7 +147,7 @@ class FileTaskHandler(logging.Handler):
 
     def __init__(self, base_log_folder: str, filename_template: str | None = 
None):
         super().__init__()
-        self.handler: logging.FileHandler | None = None
+        self.handler: logging.Handler | None = None

Review Comment:
   This is true - but it allows the lower level handler, `_RedisHandler` to not 
inherit from `logging.FileHandler`, which I think is appropriate since there is 
no file involved(?)
   
   It looks like the codebase already doesn't enforce that the lower level 
handler extends from `logging.FileHandler` - 
https://github.com/apache/airflow/blob/2940b9fa55a6a72c60c2162e541631addec3d6b8/airflow/providers/amazon/aws/log/cloudwatch_task_handler.py#L67
 which is defined in 
https://github.com/kislyuk/watchtower/blob/698ff2241befb6586269b6bbce0e305032c2d45c/watchtower/__init__.py#L139
   
   This touches on the bits that I'm unsure about - it looks like 
`FileTaskHandler` has a lot of file-related things, but also it looks like it's 
expected to extend from it when not logging to a file. Not quite sure how to 
tackle that



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

Reply via email to