Skip to content

Commit

Permalink
revert the workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala committed Jan 8, 2024
1 parent fe10f2e commit 868acc8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions airflow/providers/http/hooks/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class HttpHook(BaseHook):
conn_type = "http"
hook_name = "HTTP"

_retry_obj: Callable[..., Any]

def __init__(
self,
method: str = "POST",
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit 868acc8

Please sign in to comment.