diff --git a/tosfs/core.py b/tosfs/core.py index 7f5b3fa..d8fb234 100644 --- a/tosfs/core.py +++ b/tosfs/core.py @@ -15,7 +15,7 @@ """The core module of TOSFS.""" import logging import os -from typing import List, Optional, Tuple, Union +from typing import Any, List, Optional, Tuple, Union import tos from fsspec import AbstractFileSystem @@ -252,7 +252,7 @@ def rmdir(self, path: str) -> None: except Exception as e: raise TosfsError(f"Tosfs failed with unknown error: {e}") from e - def touch(self, path, truncate=True, **kwargs): + def touch(self, path: str, truncate: bool = True, **kwargs: Any) -> None: """Create a file at the given path. Parameters diff --git a/tosfs/tests/test_tosfs.py b/tosfs/tests/test_tosfs.py index 3adf361..059812e 100644 --- a/tosfs/tests/test_tosfs.py +++ b/tosfs/tests/test_tosfs.py @@ -154,6 +154,3 @@ def test_touch(tosfs: TosFileSystem, bucket: str, temporary_workspace: str) -> N assert tosfs.info(f"{bucket}/{temporary_workspace}/{file_name}")["size"] > 0 tosfs.touch(f"{bucket}/{temporary_workspace}/{file_name}", truncate=True) assert tosfs.info(f"{bucket}/{temporary_workspace}/{file_name}")["size"] == 0 - - -