Skip to content

Commit

Permalink
fix(client): add "title" to "new_filters" in BasicSearch.create_job
Browse files Browse the repository at this point in the history
PR Closed: #1240
  • Loading branch information
graczhual authored and linjiX committed Apr 7, 2022
1 parent 136f557 commit b461c4f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tensorbay/client/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@
from tensorbay.client.struct import Branch, Commit, Draft, Tag
from tensorbay.exception import ResourceNotExistError, StatusError

_KEY_TO_TITLES = {
"segment": "Segment",
"withLabel": "With/Without Label",
"frame": "Frame",
"sensor": "Sensor",
"size": "Size",
"category": "Category",
"attribute": "Attribute",
"keyword": "Data Name",
}


class VersionControlMixin: # pylint: disable=too-many-public-methods
"""A mixin class supporting version control methods."""
Expand Down Expand Up @@ -841,6 +852,9 @@ def create_job(
dict(zip(("key", "operator", "value", "labelType"), filter_)) for filter_ in filters
]

for new_filter in new_filters:
new_filter["title"] = _KEY_TO_TITLES[new_filter["key"]]

arguments = {
"commit": self._status.commit_id,
"conjunction": conjunction,
Expand Down

0 comments on commit b461c4f

Please sign in to comment.