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: