diff --git a/airflow/providers/http/hooks/http.py b/airflow/providers/http/hooks/http.py index 0e7dbdb12393ad..ff90915a506d44 100644 --- a/airflow/providers/http/hooks/http.py +++ b/airflow/providers/http/hooks/http.py @@ -56,8 +56,6 @@ class HttpHook(BaseHook): conn_type = "http" hook_name = "HTTP" - _retry_obj: Callable[..., Any] - def __init__( self, method: str = "POST", @@ -243,11 +241,9 @@ def run_with_advanced_retry(self, _retry_args: dict[Any, Any], *args: Any, **kwa hook.run_with_advanced_retry(endpoint="v1/test", _retry_args=retry_args) """ - # Work around "Never not callable" error in Mypy 1.8. - # This is probably an annotation issue in tenacity? Not entirely sure. - retrying = tenacity.Retrying(**_retry_args) - self._retry_obj = retrying - return retrying(self.run, *args, **kwargs) + self._retry_obj = tenacity.Retrying(**_retry_args) + + return self._retry_obj(self.run, *args, **kwargs) def url_from_endpoint(self, endpoint: str | None) -> str: """Combine base url with endpoint."""