From 77e23fb07513e604d32f4027cebe9f8601f54f60 Mon Sep 17 00:00:00 2001 From: Evildoor Date: Wed, 22 May 2019 13:02:05 +0200 Subject: [PATCH] Remove service fields before checking. Service fields are different from data fields and shouldn't be checked. --- Utils/Dataflow/071_esConsistency/consistency.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Utils/Dataflow/071_esConsistency/consistency.py b/Utils/Dataflow/071_esConsistency/consistency.py index 669ff8948..18827c930 100755 --- a/Utils/Dataflow/071_esConsistency/consistency.py +++ b/Utils/Dataflow/071_esConsistency/consistency.py @@ -160,6 +160,11 @@ def process(stage, message): if field in data: del data[field] + # Fields starting with an underscore are service fields. Some of them are + # treated in special way (see _id above). Service fields should not be + # checked, so they are removed. + data = {field: data[field] for field in data if field[0] != '_'} + # Do not check empty documents with valid _id and _type. # It's unlikely that such documents will be produced in DKB. In general, # such documents should be checked by es.exists(), and not es.get().