From c7500c57596ad5a13fe7f57ff3c81c6a86ff1f47 Mon Sep 17 00:00:00 2001 From: Dustin Black Date: Tue, 16 Jan 2024 16:40:38 +0100 Subject: [PATCH] only append metadata if it exists --- arcaflow_plugin_opensearch/opensearch_plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arcaflow_plugin_opensearch/opensearch_plugin.py b/arcaflow_plugin_opensearch/opensearch_plugin.py index cf1addf..587392a 100644 --- a/arcaflow_plugin_opensearch/opensearch_plugin.py +++ b/arcaflow_plugin_opensearch/opensearch_plugin.py @@ -46,7 +46,8 @@ def process_bulk_list_generator(): yield operation doc = item[1] # Append the global metadata to the document - doc.update(params.metadata) + if params.metadata: + doc.update(params.metadata) yield doc if params.username: