@@ -332,6 +332,7 @@ def update_dioceses(self, sparqlData, client):
332
332
response = client .upsert_wikidata_entities ('/communities/upsert' , wikidataEntities )
333
333
self .print_logs (response , 1 )
334
334
return response
335
+ return "skipped"
335
336
336
337
def update_parishes (self , sparqlData , client ):
337
338
wikidataEntities = {'wikidataEntities' : []}
@@ -344,6 +345,7 @@ def update_parishes(self, sparqlData, client):
344
345
response = client .upsert_wikidata_entities ('/communities/upsert' , wikidataEntities )
345
346
self .print_logs (response , 1 )
346
347
return response
348
+ return "skipped"
347
349
348
350
def update_churches (self , sparqlData , client ):
349
351
wikidataEntities = {'wikidataEntities' : []}
@@ -356,6 +358,7 @@ def update_churches(self, sparqlData, client):
356
358
response = client .upsert_wikidata_entities ('/places/upsert' , wikidataEntities )
357
359
self .print_logs (response , 1 )
358
360
return response
361
+ return "skipped"
359
362
360
363
def print_logs (self , data , required_level ):
361
364
if self .verbosity_level >= required_level :
@@ -448,7 +451,11 @@ def process_batch(self, data, method, run_id):
448
451
self .redis_client .hset (key_batch , "runId" , run_id )
449
452
print ("Processing batch %s/%s" % (iteration , len (batches )))
450
453
res = getattr (self .q , method )(batch , self .client )
451
- if res :
454
+ if res == "skipped" :
455
+ self .redis_client .hset (key_batch , "successCount" , "skipped" )
456
+ self .redis_client .hset (key_batch , "failureCount" , "skipped" )
457
+ self .redis_client .hset (key_batch , "status" , "skipped" )
458
+ elif res :
452
459
success_count = sum (1 for value in res .values () if value in {'Updated' , 'Inserted' })
453
460
self .redis_client .hset (key_batch , "successCount" , success_count )
454
461
self .redis_client .hset (key_batch , "failureCount" , len (res ) - success_count )
0 commit comments