Skip to content

Commit

Permalink
Improved comments and improved test code (mosaicml#1502)
Browse files Browse the repository at this point in the history
  • Loading branch information
karan6181 committed Sep 5, 2022
1 parent b9e8398 commit 3bf3569
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions composer/datasets/streaming/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_object_store(remote: str) -> ObjectStore:
elif remote.startswith('sftp://'):
return _get_sftp_object_store(remote)
else:
raise ValueError('unsupported upload scheme')
raise ValueError('unsupported download scheme')


def _get_s3_object_store(remote: str) -> S3ObjectStore:
Expand All @@ -62,9 +62,6 @@ def _get_sftp_object_store(remote: str) -> SFTPObjectStore:
return object_store


__all__ = ['download_or_wait']


def download_from_local(remote: str, local: str) -> None:
"""Download a file from remote to local.
Expand Down
10 changes: 5 additions & 5 deletions tests/datasets/test_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@

@pytest.fixture
def remote_local(tmp_path: pathlib.Path) -> Tuple[str, str]:
remote = tmp_path / 'remote'
local = tmp_path / 'local'
remote = tmp_path.joinpath('remote')
local = tmp_path.joinpath('local')
remote.mkdir()
local.mkdir()
return str(remote), str(local)


@pytest.fixture
def compressed_remote_local(tmp_path: pathlib.Path) -> Tuple[str, str, str]:
compressed = tmp_path / 'compressed'
remote = tmp_path / 'remote'
local = tmp_path / 'local'
compressed = tmp_path.joinpath('compressed')
remote = tmp_path.joinpath('remote')
local = tmp_path.joinpath('local')
list(x.mkdir() for x in [compressed, remote, local])
return tuple(str(x) for x in [compressed, remote, local])

Expand Down

0 comments on commit 3bf3569

Please sign in to comment.