From 8e0034ecb00bfdc6a1b7f2647854d3c1598c4da7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 09:10:16 +1000 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#354) 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.6.1 → v0.6.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.1...v0.6.2) * add noqa SIM115 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Matt Seddon --- .pre-commit-config.yaml | 2 +- src/datachain/catalog/catalog.py | 2 +- src/datachain/lib/arrow.py | 2 +- src/datachain/lib/webdataset.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 329de3d44..710658b7f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,7 +24,7 @@ repos: - id: trailing-whitespace exclude: '^LICENSES/' - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.6.1' + rev: 'v0.6.2' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/src/datachain/catalog/catalog.py b/src/datachain/catalog/catalog.py index 29e52728f..849d8b49e 100644 --- a/src/datachain/catalog/catalog.py +++ b/src/datachain/catalog/catalog.py @@ -1916,7 +1916,7 @@ def query( """ from datachain.query.dataset import ExecutionResult - feature_file = tempfile.NamedTemporaryFile( + feature_file = tempfile.NamedTemporaryFile( # noqa: SIM115 dir=os.getcwd(), suffix=".py", delete=False ) _, feature_module = os.path.split(feature_file.name) diff --git a/src/datachain/lib/arrow.py b/src/datachain/lib/arrow.py index 265fc22a2..9ac8a8c71 100644 --- a/src/datachain/lib/arrow.py +++ b/src/datachain/lib/arrow.py @@ -131,7 +131,7 @@ def arrow_type_mapper(col_type: pa.DataType) -> type: # noqa: PLR0911 def _nrows_file(file: File, nrows: int) -> str: - tf = NamedTemporaryFile(delete=False) + tf = NamedTemporaryFile(delete=False) # noqa: SIM115 with file.open(mode="r") as reader: with open(tf.name, "a") as writer: for row, line in enumerate(reader): diff --git a/src/datachain/lib/webdataset.py b/src/datachain/lib/webdataset.py index d4cf13f4a..0e8a7461a 100644 --- a/src/datachain/lib/webdataset.py +++ b/src/datachain/lib/webdataset.py @@ -222,7 +222,7 @@ def __init__(self, **kwargs): self._tar = None def open(self): - self._tar = tarfile.open(fileobj=super().open()) + self._tar = tarfile.open(fileobj=super().open()) # noqa: SIM115 return self def getmembers(self) -> list[tarfile.TarInfo]: