uranusjr commented on code in PR #28675:
URL: https://github.com/apache/airflow/pull/28675#discussion_r1062156579


##########
airflow/providers/mongo/hooks/mongo.py:
##########
@@ -74,12 +68,13 @@ def __exit__(
         exc_val: BaseException | None,
         exc_tb: TracebackType | None,
     ) -> None:
-        if self.client is not None:
-            self.close_conn()
+        if self.client:
+            self.client.close()
+            self.client = None
 
     def get_conn(self) -> MongoClient:
         """Fetches PyMongo Client"""
-        if self.client is not None:
+        if self.client:

Review Comment:
   That’s not how performance works. This is not a good venue to go into 
details, and the difference is indeed small. I’d prefer this PR to not change 
the code unnecessarily.



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to