Skip to content

Commit

Permalink
chore: Lower giveup log level for retried functions to warning (apach…
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrag1 authored Dec 7, 2023
1 parent c8e69e2 commit bf5b18c
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 @@ -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

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 bf5b18c

Please sign in to comment.