hussein-awala commented on code in PR #36428:
URL: https://github.com/apache/airflow/pull/36428#discussion_r1436621171
##########
airflow/providers/http/hooks/http.py:
##########
@@ -242,9 +243,11 @@ 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)
"""
- self._retry_obj = tenacity.Retrying(**_retry_args)
-
- return self._retry_obj(self.run, *args, **kwargs)
+ # 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)
Review Comment:
Another alternative solution:
```suggestion
self._retry_obj = cast(Callable, tenacity.Retrying(**_retry_args))
return self._retry_obj(self.run, *args, **kwargs)
```
--
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]