Skip to content

Commit 259702d

Browse files
author
Jesse Whitehouse
committed
Update comments for clarity
Signed-off-by: Jesse Whitehouse <[email protected]>
1 parent dda54da commit 259702d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/databricks/sql/auth/thrift_http_client.py

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ def setCustomHeaders(self, headers: Dict[str, str]):
9393
super().setCustomHeaders(headers)
9494

9595
def open(self):
96+
97+
# self.__pool replaces the self.__http used by the original THttpClient
9698
if self.scheme == "http":
9799
pool_class = HTTPConnectionPool
98100
elif self.scheme == "https":

src/databricks/sql/thrift_backend.py

+3
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,10 @@ def attempt_request(attempt):
317317
try:
318318
logger.debug("Sending request: {}".format(request))
319319
response = method(request)
320+
321+
# Calling `close()` here releases the active HTTP connection back to the pool
320322
self._transport.close()
323+
321324
logger.debug("Received response: {}".format(response))
322325
return response
323326
except OSError as err:

0 commit comments

Comments
 (0)