Skip to content

Commit 24b7a6b

Browse files
committed
reivew comments
1 parent b3f0d3d commit 24b7a6b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

labelbox/schema/organization.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, *args, **kwargs):
4444
users = Relationship.ToMany("User", False)
4545
projects = Relationship.ToMany("Project", True)
4646
webhooks = Relationship.ToMany("Webhook", False)
47-
resourceTags = Relationship.ToMany("ResourceTag", False)
47+
resourceTags = Relationship.ToMany("resource_tags", False)
4848

4949
def invite_user(
5050
self,
@@ -161,7 +161,10 @@ def get_resource_tags(self) -> List[ResourceTag]:
161161
query_str = """query GetOrganizationResourceTagsPyApi{organization{resourceTag{%s}}}""" % (
162162
query.results_query_part(ResourceTag))
163163

164-
return self.client.execute(query_str)['organization']['resourceTag']
164+
return [
165+
ResourceTag(self.client, tag) for tag in self.client.execute(
166+
query_str)['organization']['resourceTag']
167+
]
165168

166169
def get_iam_integrations(self) -> List["IAMIntegration"]:
167170
"""

labelbox/schema/project.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def update_project_resource_tags(
134134
project_id_param = "projectId"
135135
tag_ids_param = "resourceTagIds"
136136

137-
query_str = """mutation CreateProjectResourceTagsPyApi($%s:ID!,$%s:[String!]) {
137+
query_str = """mutation UpdateProjectResourceTagsPyApi($%s:ID!,$%s:[String!]) {
138138
project(where:{id:$%s}){updateProjectResourceTags(input:{%s:$%s}){%s}}}""" % (
139139
project_id_param, tag_ids_param, project_id_param, tag_ids_param,
140140
tag_ids_param, query.results_query_part(ResourceTag))
@@ -144,7 +144,10 @@ def update_project_resource_tags(
144144
tag_ids_param: resource_tag_ids
145145
})
146146

147-
return res["project"]["updateProjectResourceTags"]
147+
return [
148+
ResourceTag(self.client, tag)
149+
for tag in res["project"]["updateProjectResourceTags"]
150+
]
148151

149152
def labels(self, datasets=None, order_by=None) -> PaginatedCollection:
150153
""" Custom relationship expansion method to support limited filtering.

0 commit comments

Comments
 (0)