From e493463dc8bd8ad350b18b2f8f6b99f5e93b52b6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:23:08 -0700 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.1 → v0.5.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.1...v0.5.2) - [github.com/macisamuele/language-formatters-pre-commit-hooks: v2.13.0 → v2.14.0](https://github.com/macisamuele/language-formatters-pre-commit-hooks/compare/v2.13.0...v2.14.0) * lint fabric.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ivan Shcheklein --- .pre-commit-config.yaml | 4 ++-- src/dvclive/fabric.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aa31b0c9..5186f083 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,13 +29,13 @@ repos: .*\.ipynb )$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.1" + rev: "v0.5.2" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.13.0 + rev: v2.14.0 hooks: - id: pretty-format-toml args: [--autofix, --no-sort] diff --git a/src/dvclive/fabric.py b/src/dvclive/fabric.py index 1b99b097..0e0903df 100644 --- a/src/dvclive/fabric.py +++ b/src/dvclive/fabric.py @@ -132,7 +132,9 @@ def _sanitize_params(params: Dict[str, Any]) -> Dict[str, Any]: } # logging of argparse.Namespace is not supported, sanitize as string - params = {k: str(v) if type(v) == Namespace else v for k, v in params.items()} + params = { + k: str(v) if isinstance(v, Namespace) else v for k, v in params.items() + } return params # noqa: RET504