Skip to content

Commit

Permalink
more target repository
Browse files Browse the repository at this point in the history
  • Loading branch information
bedroesb committed Nov 5, 2024
1 parent e39fdfc commit 41ecbca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions mars-cli/mars_lib/models/isa_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,17 @@ def detect_target_repo_comments(cls, v: List[Comment]) -> Optional[List[Comment]
comment for comment in v if comment.name == TARGET_REPO_KEY
]
if len(target_repo_comments) == 0:
raise ValueError("'target repository' comment is missing")
raise ValueError("'target_repository' comment is missing")
elif len(target_repo_comments) > 1:
raise ValueError("Multiple 'target repository' comments found")
raise ValueError("Multiple 'target_repository' comments found")
else:
if target_repo_comments[0].value in [
item.value for item in TargetRepository
]:
return v
else:
raise ValueError(
f"Invalid 'target repository' value: '{target_repo_comments[0].value}'"
f"Invalid 'target_repository' value: '{target_repo_comments[0].value}'"
)


Expand Down
4 changes: 2 additions & 2 deletions mars-cli/tests/test_isa_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_target_repo_comment_validator():
"comments": [
{
"@id": "comment_001",
"name": "target repository",
"name": "target_repository",
"value": TargetRepository.ENA,
}
],
Expand All @@ -108,7 +108,7 @@ def test_target_repo_comment_validator():
"comments": [
{
"@id": "comment_002",
"name": "target repository",
"name": "target_repository",
"value": "my special repo",
}
],
Expand Down

0 comments on commit 41ecbca

Please sign in to comment.