From 5b728c29c110eb2b7a7cd93928876501509e2ef5 Mon Sep 17 00:00:00 2001 From: Ashok Kumar <127404300+AshokChoudhary11@users.noreply.github.com> Date: Sat, 4 May 2024 10:31:31 +0530 Subject: [PATCH] Replace check for Elasticsearch to str/list in ensure_es_client (#690) --- eland/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eland/common.py b/eland/common.py index 71e9bb6..d582fba 100644 --- a/eland/common.py +++ b/eland/common.py @@ -309,7 +309,11 @@ def ensure_es_client( ) -> Elasticsearch: if isinstance(es_client, tuple): es_client = list(es_client) - if not isinstance(es_client, Elasticsearch): + if ( + isinstance(es_client, str) + or isinstance(es_client, list) + or isinstance(es_client, tuple) + ): es_client = Elasticsearch(es_client) return es_client