From 06bcdbcd3a9bcf46a4fa00f90a4d9e5b4147561a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 19:33:16 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/dvc_objects/db.py | 2 +- src/dvc_objects/executors.py | 2 +- src/dvc_objects/fs/generic.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dvc_objects/db.py b/src/dvc_objects/db.py index ae1d667..69ce9a1 100644 --- a/src/dvc_objects/db.py +++ b/src/dvc_objects/db.py @@ -123,7 +123,7 @@ def add_bytes(self, oid: str, data: Union[bytes, BinaryIO]) -> None: raise ObjectDBPermissionError("Cannot add to read-only ODB") if isinstance(data, bytes): - fobj: "BinaryIO" = BytesIO(data) + fobj: BinaryIO = BytesIO(data) size: Optional[int] = len(data) else: fobj = data diff --git a/src/dvc_objects/executors.py b/src/dvc_objects/executors.py index 529f162..18cc681 100644 --- a/src/dvc_objects/executors.py +++ b/src/dvc_objects/executors.py @@ -86,7 +86,7 @@ def create_taskset(n: int) -> dict[asyncio.Task, int]: for fut in done: try: result = fut.result() - except Exception as exc: # noqa: BLE001 + except Exception as exc: if not return_exceptions: for pending_fut in pending: pending_fut.cancel() diff --git a/src/dvc_objects/fs/generic.py b/src/dvc_objects/fs/generic.py index 71e7c79..00085c0 100644 --- a/src/dvc_objects/fs/generic.py +++ b/src/dvc_objects/fs/generic.py @@ -116,7 +116,7 @@ def _copy_one(from_p: "AnyFSPath", to_p: "AnyFSPath"): return to_fs.put_file( fobj, to_p, size=size, callback=child, **put_file_kwargs ) - except Exception as exc: # noqa: BLE001 + except Exception as exc: if on_error is not None: on_error(from_p, to_p, exc) else: @@ -151,7 +151,7 @@ def _put_one(from_path: "AnyFSPath", to_path: "AnyFSPath"): return to_fs.put_file( from_path, to_path, callback=child, **put_file_kwargs ) - except Exception as exc: # noqa: BLE001 + except Exception as exc: if on_error is not None: on_error(from_path, to_path, exc) else: @@ -217,7 +217,7 @@ def _get_one(from_path: "AnyFSPath", to_path: "AnyFSPath"): return from_fs.get_file( from_path, tmp_file, callback=child, **get_file_kwargs ) - except Exception as exc: # noqa: BLE001 + except Exception as exc: if on_error is not None: on_error(from_path, to_path, exc) else: @@ -375,7 +375,7 @@ def transfer( # noqa: PLR0912, C901 on_error(from_p, to_p, exc) else: raise - except Exception as exc: # noqa: BLE001 + except Exception as exc: if on_error is not None: on_error(from_p, to_p, exc) else: