Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 10, 2024
1 parent daef653 commit 31f2443
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/dvc_objects/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/dvc_objects/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions src/dvc_objects/fs/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 31f2443

Please sign in to comment.