@@ -89,6 +89,9 @@ class Project(DbObject, Updateable, Deletable):
8989 benchmarks = Relationship .ToMany ("Benchmark" , False )
9090 ontology = Relationship .ToOne ("Ontology" , True )
9191
92+ #
93+ _wait_processing_max_seconds = 3600
94+
9295 def update (self , ** kwargs ):
9396 """ Updates this project with the specified attributes
9497
@@ -594,7 +597,8 @@ def create_batch(self,
594597 if not len (dr_ids ):
595598 raise ValueError ("You need at least one data row in a batch" )
596599
597- self ._wait_until_data_rows_are_processed (data_rows ,)
600+ self ._wait_until_data_rows_are_processed (
601+ data_rows , self ._wait_processing_max_seconds )
598602 method = 'createBatchV2'
599603 query_str = """mutation %sPyApi($projectId: ID!, $batchInput: CreateBatchInput!) {
600604 project(where: {id: $projectId}) {
@@ -980,7 +984,7 @@ def _is_url_valid(url: Union[str, Path]) -> bool:
980984 raise ValueError (
981985 f'Invalid annotations given of type: { type (annotations )} ' )
982986
983- def _wait_until_data_rows_are_processed (self , data_row_ids : List [str ], wait_processing_max_seconds = 3600 , sleep_interval = 30 ):
987+ def _wait_until_data_rows_are_processed (self , data_row_ids : List [str ], wait_processing_max_seconds : int , sleep_interval = 30 ):
984988 """ Wait until all the specified data rows are processed"""
985989 start_time = datetime .now ()
986990 while True :
@@ -992,6 +996,9 @@ def _wait_until_data_rows_are_processed(self, data_row_ids: List[str], wait_proc
992996 all_good = self .__check_data_rows_have_been_processed (data_row_ids )
993997 if all_good :
994998 return
999+
1000+ logger .debug (
1001+ 'Some of the data rows are still being processed, waiting...' )
9951002 time .sleep (sleep_interval )
9961003
9971004 def __check_data_rows_have_been_processed (self , data_row_ids : List [str ]):
0 commit comments