uranusjr commented on a change in pull request #16110:
URL: https://github.com/apache/airflow/pull/16110#discussion_r650767364



##########
File path: airflow/utils/timeout.py
##########
@@ -22,12 +22,43 @@
 from airflow.utils.platform import IS_WINDOWS
 from airflow.exceptions import AirflowTaskTimeout
 from airflow.utils.log.logging_mixin import LoggingMixin
+from typing import ContextManager, Type
 
-TIMER_THREAD_ATTR = '_timer_thread'
+_timeout = ContextManager[None]
 
 
-class timeout(LoggingMixin):  # pylint: disable=invalid-name
-    """To be used in a ``with`` block and timeout its content."""
+class _timeout_windows(_timeout, LoggingMixin):
+
+    def __init__(self, seconds=1, error_message='Timeout'):
+        super().__init__()
+        self._timer: Timer = None

Review comment:
       If you [set up 
pre-commit](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#contribution-workflow),
 this (and other linter errors in this PR) can be more easily caught before you 
push the changes.




-- 
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:
us...@infra.apache.org


Reply via email to