Subham-KRLX commented on code in PR #66065:
URL: https://github.com/apache/airflow/pull/66065#discussion_r3223301495


##########
providers/elasticsearch/src/airflow/providers/elasticsearch/hooks/elasticsearch.py:
##########
@@ -135,9 +136,9 @@ def __init__(
         netloc = f"{host}:{port}"
         self.url = parse.urlunparse((scheme, netloc, "/", None, None, None))
         if user and password:
-            self.es = Elasticsearch(self.url, basic_auth=(user, password), 
**kwargs)
+            self.es = apply_compat_with(Elasticsearch(self.url, 
basic_auth=(user, password), **kwargs))

Review Comment:
    I checked the Elasticsearch hook file. The ESConnection constructor creates 
a single Elasticsearch instance assigned to self.es. Therefore 
apply_compat_with(Elasticsearch(...)) wraps that single client in place and 
does not create two clients. If you found another site that builds two clients 
please point me to the file and line and I will patch it. Otherwise this looks 
fine to me.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to