From 407a1974787429466a71f62c40e9b5957467f0c0 Mon Sep 17 00:00:00 2001 From: hussein-awala Date: Tue, 26 Dec 2023 22:28:38 +0100 Subject: [PATCH] workaround for Never not callable --- airflow/providers/http/hooks/http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/airflow/providers/http/hooks/http.py b/airflow/providers/http/hooks/http.py index e287f53a41fcb..0e7dbdb12393a 100644 --- a/airflow/providers/http/hooks/http.py +++ b/airflow/providers/http/hooks/http.py @@ -245,9 +245,9 @@ def run_with_advanced_retry(self, _retry_args: dict[Any, Any], *args: Any, **kwa """ # Work around "Never not callable" error in Mypy 1.8. # This is probably an annotation issue in tenacity? Not entirely sure. - self._retry_obj: Any = tenacity.Retrying(**_retry_args) - - return self._retry_obj(self.run, *args, **kwargs) + retrying = tenacity.Retrying(**_retry_args) + self._retry_obj = retrying + return retrying(self.run, *args, **kwargs) def url_from_endpoint(self, endpoint: str | None) -> str: """Combine base url with endpoint."""