Skip to content

Commit

Permalink
fix unknown author appearance (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
younik committed Sep 3, 2024
1 parent 7b08029 commit be4ee5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions minari/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ def _show_dataset_table(datasets: Dict[str, Dict[str, Any]], table_title: str):
dataset_id = f"{dataset_prefix}-v{max(versions)}"
dst_metadata = datasets[dataset_id]
author = dst_metadata.get("author", "Unknown")
if isinstance(author, Iterable):
if not isinstance(author, str) and isinstance(author, Iterable):
author = ", ".join(author)
dataset_size = dst_metadata.get("dataset_size", "Unknown")
if dataset_size != "Unknown":
dataset_size = f"{str(dataset_size)} MB"
author_email = dst_metadata.get("author_email", "Unknown")
if isinstance(author_email, Iterable):
if not isinstance(author_email, str) and isinstance(author_email, Iterable):
author_email = ", ".join(author_email)

assert isinstance(dst_metadata["dataset_id"], str)
Expand Down
6 changes: 3 additions & 3 deletions minari/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ def get_env_spec_dict(env_spec: EnvSpec) -> Dict[str, str]:

def get_dataset_spec_dict(dataset_spec: Dict) -> Dict[str, str]:
"""Create dict of the dataset specs, including observation and action space."""
code_link = dataset_spec["code_permalink"]
code_link = dataset_spec.get("code_permalink")
action_space = dataset_spec.get("action_space")
obs_space = dataset_spec.get("observation_space")

Expand Down Expand Up @@ -532,10 +532,10 @@ def get_dataset_spec_dict(dataset_spec: Dict) -> Dict[str, str]:
"supported" if version in supported_dataset_versions else "not supported"
)
author = dataset_spec.get("author", "Not provided")
if isinstance(author, Iterable):
if not isinstance(author, str) and isinstance(author, Iterable):
author = ", ".join(author)
email = dataset_spec.get("author_email", "Not provided")
if isinstance(email, Iterable):
if not isinstance(email, str) and isinstance(email, Iterable):
email = ", ".join(email)
assert isinstance(author, str)
assert isinstance(email, str)
Expand Down

0 comments on commit be4ee5b

Please sign in to comment.