You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/12/08 14:14:43 UTC

(superset) 04/11: chore: Lower giveup log level for retried functions to warning (#26188)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 5c24c580dd5561b3d8b7fbc15644ab41e3cad784
Author: Jack Fragassi <jf...@gmail.com>
AuthorDate: Wed Dec 6 16:33:19 2023 -0800

    chore: Lower giveup log level for retried functions to warning (#26188)
    
    (cherry picked from commit bf5b18ccb14cdf5fbc16037fb4db096e577799f2)
---
 superset/utils/retries.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/superset/utils/retries.py b/superset/utils/retries.py
index 8a1e6b95ea..3af821362d 100644
--- a/superset/utils/retries.py
+++ b/superset/utils/retries.py
@@ -15,6 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
+import logging
 from collections.abc import Generator
 from typing import Any, Callable, Optional
 
@@ -26,6 +27,7 @@ def retry_call(
     *args: Any,
     strategy: Callable[..., Generator[int, None, None]] = backoff.constant,
     exception: type[Exception] = Exception,
+    giveup_log_level: int = logging.WARNING,
     fargs: Optional[list[Any]] = None,
     fkwargs: Optional[dict[str, Any]] = None,
     **kwargs: Any
@@ -33,6 +35,7 @@ def retry_call(
     """
     Retry a given call.
     """
+    kwargs["giveup_log_level"] = giveup_log_level
     decorated = backoff.on_exception(strategy, exception, *args, **kwargs)(func)
     fargs = fargs or []
     fkwargs = fkwargs or {}