@@ -89,22 +89,6 @@ def delete_model_run(self):
89
89
ids_param : str (self .uid )
90
90
})
91
91
92
-
93
- class AnnotationGroup (DbObject ):
94
- label_id = Field .String ("label_id" )
95
- model_run_id = Field .String ("model_run_id" )
96
- data_row = Relationship .ToOne ("DataRow" , False , cache = True )
97
-
98
- def __init__ (self , client , model_id , * args , ** kwargs ):
99
- super ().__init__ (client , * args , ** kwargs )
100
- self .model_id = model_id
101
-
102
- @property
103
- def url (self ):
104
- app_url = self .client .app_url
105
- endpoint = f"{ app_url } /models/{ self .model_id } /{ self .model_run_id } /AllDatarowsSlice/{ self .uid } ?view=carousel"
106
- return endpoint
107
-
108
92
def delete_annotation_groups (self , data_row_ids ):
109
93
""" Deletes annotation groups by data row ids for a model run.
110
94
@@ -115,11 +99,28 @@ def delete_annotation_groups(self, data_row_ids):
115
99
"""
116
100
model_run_id_param = "modelRunId"
117
101
data_row_ids_param = "dataRowIds"
118
- query_str = """mutation DeleteModelRunDataRowsPyApi($%s: ID!, $%s: [ID!]! {
102
+ query_str = """mutation DeleteModelRunDataRowsPyApi($%s: ID!, $%s: [ID!]!) {
119
103
deleteModelRunDataRows(where: {modelRunId: $%s, dataRowIds: $%s})}""" % (
120
104
model_run_id_param , data_row_ids_param , model_run_id_param , data_row_ids_param
121
105
)
122
106
self .client .execute (query_str , {
123
- model_run_id_param : self .model_run_id ,
107
+ model_run_id_param : self .uid ,
124
108
data_row_ids_param : data_row_ids
125
109
})
110
+
111
+
112
+ class AnnotationGroup (DbObject ):
113
+ label_id = Field .String ("label_id" )
114
+ model_run_id = Field .String ("model_run_id" )
115
+ data_row = Relationship .ToOne ("DataRow" , False , cache = True )
116
+
117
+ def __init__ (self , client , model_id , * args , ** kwargs ):
118
+ super ().__init__ (client , * args , ** kwargs )
119
+ self .model_id = model_id
120
+
121
+ @property
122
+ def url (self ):
123
+ app_url = self .client .app_url
124
+ endpoint = f"{ app_url } /models/{ self .model_id } /{ self .model_run_id } /AllDatarowsSlice/{ self .uid } ?view=carousel"
125
+ return endpoint
126
+
0 commit comments