@@ -113,7 +113,7 @@ def identifier_list_workflow_executor(
113113        settings_dict ,
114114        s3_client ,
115115        object_name ,
116-         version   =   None ,
116+         version = None ,
117117):
118118    """ 
119119    Grabs a file called identifiers.json from the bucket 
@@ -122,17 +122,20 @@ def identifier_list_workflow_executor(
122122    If not return FAILED, if it does execute the data_provider_workflow 
123123    for every pid in the list. 
124124
125-     :param data_provider_workflow: A function representing the data provider workflow. 
125+     :param object_name: Can be identifiers.json or identifiers-deleted.json 
126+     :param data_provider_workflow: A function representing the workflow. 
126127    :param version: The version of the workflow to be executed. 
127-     :param settings_dict: A dictionary containing the  settings including the BUCKET_NAME. 
128-     :param s3_client: An object representing the Boto3 S3 client to access the bucket . 
129-     :return: 'SUCCESS' if the workflow is executed successfully , 'FAILED' otherwise. 
128+     :param settings_dict: The  settings including the BUCKET_NAME. 
129+     :param s3_client: An object representing the Boto3 S3 client. 
130+     :return: 'SUCCESS' if the workflow succeeds , 'FAILED' otherwise. 
130131    """ 
131132    bucket_name  =  settings_dict .BUCKET_NAME 
132-     identifiers_dict  =  retrieve_identifiers_from_bucket (s3_client , bucket_name , object_name )
133+     identifiers_dict  =  retrieve_identifiers_from_bucket (s3_client , bucket_name ,
134+                                                         object_name )
133135    for  pid  in  identifiers_dict ['pids' ]:
134136        if  version :
135-             data_provider_workflow (pid , settings_dict , version , return_state = True )
137+             data_provider_workflow (pid , version , settings_dict ,
138+                                    return_state = True )
136139        else :
137140            data_provider_workflow (pid , settings_dict , return_state = True )
138141
@@ -244,6 +247,7 @@ def failed_dataverse_ingestion_hook(flow, flow_run, state):
244247
245248    update_identifiers_json (bucket_name , "identifiers.json" , pid )
246249
250+ 
247251def  failed_dataverse_deletion_hook (flow , flow_run , state ):
248252    logger  =  get_run_logger ()
249253    settings_dict  =  flow_run .parameters ["settings_dict" ]
@@ -261,7 +265,8 @@ def failed_dataverse_deletion_hook(flow, flow_run, state):
261265def  update_identifiers_json (bucket_name , object_name , failed_pid ):
262266    s3_client  =  create_s3_client ()
263267    create_identifiers_json (s3_client , bucket_name , object_name )
264-     identifiers_dict  =  retrieve_identifiers_from_bucket (s3_client , bucket_name , object_name )
268+     identifiers_dict  =  retrieve_identifiers_from_bucket (s3_client , bucket_name ,
269+                                                         object_name )
265270    identifiers_dict ['pids' ].append (failed_pid )
266271
267272    updated_data  =  json .dumps (identifiers_dict ).encode ('utf-8' )
0 commit comments