Skip to content

Commit

Permalink
Default giveup log level to warning in retry_call
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrag1 committed Dec 5, 2023
1 parent d2cce51 commit 393814c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions superset/utils/retries.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# under the License.

from collections.abc import Generator
import logging
from typing import Any, Callable, Optional

import backoff
Expand All @@ -26,13 +27,15 @@ 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
) -> Any:
"""
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 {}
Expand Down

0 comments on commit 393814c

Please sign in to comment.