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 committed Apr 6, 2022
1 parent 534ff59 commit 12c55d6
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 12c55d6

Please sign in to comment.