Skip to content

Commit 7db4103

Browse files
author
liyang
committed
make lint happy
1 parent 4d65b59 commit 7db4103

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

megfile/fsspec.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _make_entry(filesystem, info):
6363

6464
class BaseFSSpecPath(URIPath):
6565
protocol: str
66-
filesystem: 'fsspec.AbstractFileSystem'
66+
filesystem: "fsspec.AbstractFileSystem"
6767

6868
def __init__(self, path: PathLike, *other_paths: PathLike):
6969
super().__init__(path, *other_paths)
@@ -375,7 +375,7 @@ def sync(
375375
self.path_without_protocol, dst_path, recursive=True
376376
)
377377

378-
def rename(self, dst_path: PathLike, overwrite: bool = True) -> "BaseFSSpecPath":
378+
def rename(self, dst_path: PathLike, overwrite: bool = True):
379379
"""
380380
rename file with fsspec
381381
@@ -384,7 +384,7 @@ def rename(self, dst_path: PathLike, overwrite: bool = True) -> "BaseFSSpecPath"
384384
"""
385385
self.filesystem.mv(self.path_without_protocol, dst_path, recursive=False)
386386

387-
def move(self, dst_path: PathLike, overwrite: bool = True) -> "BaseFSSpecPath":
387+
def move(self, dst_path: PathLike, overwrite: bool = True):
388388
"""
389389
move file/directory with fsspec
390390
@@ -393,7 +393,7 @@ def move(self, dst_path: PathLike, overwrite: bool = True) -> "BaseFSSpecPath":
393393
"""
394394
self.filesystem.mv(self.path_without_protocol, dst_path, recursive=True)
395395

396-
def unlink(self, missing_ok: bool = False) -> None:
396+
def unlink(self, missing_ok: bool = False):
397397
"""
398398
Remove the file with fsspec
399399
@@ -403,7 +403,7 @@ def unlink(self, missing_ok: bool = False) -> None:
403403
return
404404
self.filesystem.rm(self.path_without_protocol, recursive=False)
405405

406-
def remove(self, missing_ok: bool = False) -> None:
406+
def remove(self, missing_ok: bool = False):
407407
"""
408408
Remove the file or directory with fsspec
409409
@@ -456,7 +456,7 @@ def create_generator():
456456
FileNotFoundError("No match any file in: %r" % self.path_with_protocol),
457457
)
458458

459-
def scandir(self) -> Iterator[FileEntry]:
459+
def scandir(self, followlinks: bool = False) -> Iterator[FileEntry]:
460460
"""
461461
Get all content of given file path.
462462

tests/test_smart_path.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
)
1313
from megfile.fs_path import FSPath
1414
from megfile.hdfs_path import HdfsPath
15+
from megfile.hf_path import HFPath
1516
from megfile.http_path import HttpPath, HttpsPath
1617
from megfile.interfaces import Access
1718
from megfile.s3_path import S3Path
@@ -58,21 +59,23 @@ def s3_empty_client(mocker):
5859

5960

6061
def test_register_result():
61-
assert len(SmartPath._registered_protocols) == 7
62+
assert len(SmartPath._registered_protocols) == 8
6263
assert S3Path.protocol in SmartPath._registered_protocols
6364
assert FSPath.protocol in SmartPath._registered_protocols
6465
assert HttpPath.protocol in SmartPath._registered_protocols
6566
assert HttpsPath.protocol in SmartPath._registered_protocols
6667
assert StdioPath.protocol in SmartPath._registered_protocols
6768
assert SftpPath.protocol in SmartPath._registered_protocols
6869
assert HdfsPath.protocol in SmartPath._registered_protocols
70+
assert HFPath.protocol in SmartPath._registered_protocols
6971

7072
assert SmartPath._registered_protocols[S3Path.protocol] == S3Path
7173
assert SmartPath._registered_protocols[FSPath.protocol] == FSPath
7274
assert SmartPath._registered_protocols[HttpPath.protocol] == HttpPath
7375
assert SmartPath._registered_protocols[HttpsPath.protocol] == HttpsPath
7476
assert SmartPath._registered_protocols[StdioPath.protocol] == StdioPath
7577
assert SmartPath._registered_protocols[HdfsPath.protocol] == HdfsPath
78+
assert SmartPath._registered_protocols[HFPath.protocol] == HFPath
7679
assert SmartPath.from_uri(FS_TEST_ABSOLUTE_PATH) == SmartPath(FS_TEST_ABSOLUTE_PATH)
7780

7881

0 commit comments

Comments
 (0)