diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1a6b0e5a5..08cb9ab7e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: # - '@trivago/prettier-plugin-sort-imports@3.2.0' # removing it since pre-commit install fails - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 + rev: 7.1.1 hooks: - id: flake8 files: "^querybook/(server|tests)/.*\\.py$" diff --git a/querybook/server/lib/utils/utils.py b/querybook/server/lib/utils/utils.py index 5206c23ca..77bb809c5 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[str | bool]) -> bool: if value is None: return False + if isinstance(value, bool): + return value return value.lower() in ("yes", "true", "t", "1")