Skip to content

Commit

Permalink
[fix] Check if the remo is remote when running aim runs ls (#2716)
Browse files Browse the repository at this point in the history
  • Loading branch information
alberttorosyan authored May 4, 2023
1 parent a1b1720 commit ce1ba8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions aim/cli/runs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ def runs(ctx, repo):
def list_runs(ctx):
"""List Runs available in Repo."""
repo_path = ctx.obj['repo']
if not Repo.exists(repo_path):
click.echo(f'\'{repo_path}\' is not a valid aim repo.')
exit(1)
if not Repo.is_remote_path(repo_path):
if not Repo.exists(repo_path):
click.echo(f'\'{repo_path}\' is not a valid aim repo.')
exit(1)

repo = Repo.from_path(repo_path)
run_hashes = repo.list_all_runs()
Expand Down
3 changes: 2 additions & 1 deletion aim/ext/transport/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def get_structured_run(hash_, read_only, created_at, **kwargs):
repo = Repo.from_path(repo_path)
else:
repo = Repo.default_repo()
created_at = datetime.fromtimestamp(created_at, tz=pytz.utc).replace(tzinfo=None)
if created_at is not None:
created_at = datetime.fromtimestamp(created_at, tz=pytz.utc).replace(tzinfo=None)
return ResourceRef(repo.request_props(hash_, read_only, created_at))


Expand Down
2 changes: 1 addition & 1 deletion aim/storage/structured/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, client: 'Client',
kwargs = {
'hash_': hash_,
'read_only': read_only,
'created_at': created_at.timestamp()
'created_at': created_at.timestamp() if created_at is not None else created_at
}

self.init_args = pack_args(encode_tree(kwargs))
Expand Down

0 comments on commit ce1ba8a

Please sign in to comment.