Skip to content

Commit 9fa4366

Browse files
authored
fix traces streaming (#8277)
1 parent 2c45eab commit 9fa4366

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/datasets/utils/file_utils.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,28 @@ def exists(self, download_config: Optional[DownloadConfig] = None):
11131113
"""
11141114
return xexists(str(self), download_config=download_config)
11151115

1116+
def is_file(self, download_config: Optional[DownloadConfig] = None):
1117+
"""Extend `pathlib.Path.is_file` method to support both local and remote files.
1118+
1119+
Args:
1120+
download_config : mainly use token or storage_options to support different platforms and auth types.
1121+
1122+
Returns:
1123+
`bool`
1124+
"""
1125+
return xisfile(str(self), download_config=download_config)
1126+
1127+
def is_dir(self, download_config: Optional[DownloadConfig] = None):
1128+
"""Extend `pathlib.Path.is_dir` method to support both local and remote files.
1129+
1130+
Args:
1131+
download_config : mainly use token or storage_options to support different platforms and auth types.
1132+
1133+
Returns:
1134+
`bool`
1135+
"""
1136+
return xisdir(str(self), download_config=download_config)
1137+
11161138
def glob(self, pattern, download_config: Optional[DownloadConfig] = None):
11171139
"""Glob function for argument of type :obj:`~pathlib.Path` that supports both local paths end remote URLs.
11181140

0 commit comments

Comments
 (0)