Skip to content

Commit

Permalink
fix: Make str to bool noop if input is bool (#1499)
Browse files Browse the repository at this point in the history
* fix: Make str to bool noop if input is bool

* update typing
  • Loading branch information
czgu authored Oct 18, 2024
1 parent e428283 commit ee25d74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion querybook/server/lib/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit ee25d74

Please sign in to comment.