File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,22 @@ def update_project_resource_tags(
206206 for tag in res ["project" ]["updateProjectResourceTags" ]
207207 ]
208208
209+ def get_resource_tags (self ) -> List [ResourceTag ]:
210+ """
211+ Returns tags for a project
212+ """
213+ query_str = """query GetProjectResourceTagsPyApi($projectId: ID!) {
214+ project(where: {id: $projectId}) {
215+ name
216+ resourceTags {%s}
217+ }
218+ }""" % (query .results_query_part (ResourceTag ))
219+
220+ results = self .client .execute (
221+ query_str , {"projectId" : self .uid })['project' ]['resourceTags' ]
222+
223+ return [ResourceTag (self .client , tag ) for tag in results ]
224+
209225 def labels (self , datasets = None , order_by = None ) -> PaginatedCollection :
210226 """ Custom relationship expansion method to support limited filtering.
211227
Original file line number Diff line number Diff line change @@ -111,6 +111,10 @@ def delete_tag(tag_id: str):
111111 assert len (project_resource_tag ) == 1
112112 assert project_resource_tag [0 ].uid == tagA .uid
113113
114+ project_resource_tags = client .get_project (p1 .uid ).get_resource_tags ()
115+ assert len (project_resource_tags ) == 1
116+ assert project_resource_tags [0 ].uid == tagA .uid
117+
114118 delete_tag (tagA .uid )
115119 delete_tag (tagB .uid )
116120
You can’t perform that action at this time.
0 commit comments