Skip to content

Commit

Permalink
fix: get_tag_detail updated return types
Browse files Browse the repository at this point in the history
  • Loading branch information
marksie1988 committed Jun 28, 2022
1 parent 8720852 commit 60706fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyarr/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,9 @@ def get_tag(self, id_: Optional[int] = None) -> list[dict[str, Any]]:
return self.assert_return(path, self.ver_uri, list)

# GET /tag/detail/{id}
def get_tag_detail(self, id_: Optional[int] = None) -> list[dict[str, Any]]:
def get_tag_detail(
self, id_: Optional[int] = None
) -> Union[list[dict[str, Any]], dict[str, Any]]:
"""Returns all tags or specific tag by database id with detailed information
Args:
Expand All @@ -618,7 +620,7 @@ def get_tag_detail(self, id_: Optional[int] = None) -> list[dict[str, Any]]:
list[dict[str, Any]]: List of dictionaries with items
"""
path = f"tag/detail/{id_}" if id_ else "tag/detail"
return self.assert_return(path, self.ver_uri, list)
return self.assert_return(path, self.ver_uri, list if id_ is None else dict)

# POST /tag
def create_tag(self, label: str) -> dict[str, Any]:
Expand Down

0 comments on commit 60706fc

Please sign in to comment.