diff --git a/querybook/server/lib/utils/utils.py b/querybook/server/lib/utils/utils.py index 5206c23ca..d1add40ec 100644 --- a/querybook/server/lib/utils/utils.py +++ b/querybook/server/lib/utils/utils.py @@ -162,8 +162,10 @@ def get_default_args(func): } -def str_to_bool(value: Optional[str]) -> bool: +def str_to_bool(value: Optional[Union[str, bool]]) -> bool: if value is None: return False + if isinstance(value, bool): + return value return value.lower() in ("yes", "true", "t", "1")