@@ -48,9 +48,9 @@ class Status(Enum):
4848 FAILED = "FAILED"
4949
5050 def upsert_labels (self ,
51- label_ids : Optional [List [str ]] = None ,
52- project_id : Optional [str ] = None ,
53- timeout_seconds = 3600 ):
51+ label_ids : Optional [List [str ]] = None ,
52+ project_id : Optional [str ] = None ,
53+ timeout_seconds = 3600 ):
5454 """ Adds data rows and labels to a Model Run
5555 Args:
5656 label_ids (list): label ids to insert
@@ -64,21 +64,20 @@ def upsert_labels(self,
6464 use_project_id = project_id is not None
6565
6666 if not use_label_ids and not use_project_id :
67- raise ValueError ("Must provide at least one label id or a project id" )
67+ raise ValueError (
68+ "Must provide at least one label id or a project id" )
6869
6970 if use_label_ids and use_project_id :
7071 raise ValueError ("Must only one of label ids, project id" )
7172
7273 if use_label_ids :
7374 return self ._upsert_labels_by_label_ids (label_ids )
74- else : # use_project_id
75+ else : # use_project_id
7576 return self ._upsert_labels_by_project_id (project_id )
7677
77-
78-
7978 def _upsert_labels_by_label_ids (self ,
80- label_ids : List [str ],
81- timeout_seconds = 3600 ):
79+ label_ids : List [str ],
80+ timeout_seconds = 3600 ):
8281 mutation_name = 'createMEAModelRunLabelRegistrationTask'
8382 create_task_query_str = """mutation createMEAModelRunLabelRegistrationTaskPyApi($modelRunId: ID!, $labelIds : [ID!]!) {
8483 %s(where : { id : $modelRunId}, data : {labelIds: $labelIds})}
@@ -98,11 +97,11 @@ def _upsert_labels_by_label_ids(self,
9897 status_query_str , {'where' : {
9998 'id' : task_id
10099 }})['MEALabelRegistrationTaskStatus' ],
101- timeout_seconds = timeout_seconds )
100+ timeout_seconds = timeout_seconds )
102101
103102 def _upsert_labels_by_project_id (self ,
104- project_id : str ,
105- timeout_seconds = 3600 ):
103+ project_id : str ,
104+ timeout_seconds = 3600 ):
106105 mutation_name = 'createMEAModelRunProjectLabelRegistrationTask'
107106 create_task_query_str = """mutation createMEAModelRunProjectLabelRegistrationTaskPyApi($modelRunId: ID!, $projectId : ID!) {
108107 %s(where : { modelRunId : $modelRunId, projectId: $projectId})}
@@ -122,8 +121,7 @@ def _upsert_labels_by_project_id(self,
122121 status_query_str , {'where' : {
123122 'id' : task_id
124123 }})['MEALabelRegistrationTaskStatus' ],
125- timeout_seconds = timeout_seconds )
126-
124+ timeout_seconds = timeout_seconds )
127125
128126 def upsert_data_rows (self ,
129127 data_row_ids = None ,
0 commit comments