Skip to content

Commit d8159e7

Browse files
Revert "Merge remote-tracking branch 'upstream/sea-migration' into decouple-session"
This reverts commit dbb2ec5, reversing changes made to 7192f11. Signed-off-by: varun-edachali-dbx <[email protected]>
1 parent 913da63 commit d8159e7

File tree

5 files changed

+6
-43
lines changed

5 files changed

+6
-43
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# the repo. Unless a later match takes precedence, these
33
# users will be requested for review when someone opens a
44
# pull request.
5-
* @deeksha-db @samikshya-db @jprakash-db @jackyhu-db @madhav-db @gopalldb @jayantsing-db @vikrantpuppala @shivam2680
5+
* @deeksha-db @samikshya-db @jprakash-db @yunbodeng-db @jackyhu-db @benc-db

src/databricks/sql/backend/thrift_backend.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ def __init__(
138138
# max_download_threads
139139
# Number of threads for handling cloud fetch downloads. Defaults to 10
140140

141-
logger.debug(
142-
"ThriftBackend.__init__(server_hostname=%s, port=%s, http_path=%s)",
143-
server_hostname,
144-
port,
145-
http_path,
146-
)
147-
148141
port = port or 443
149142
if kwargs.get("_connection_uri"):
150143
uri = kwargs.get("_connection_uri")
@@ -416,8 +409,6 @@ def attempt_request(attempt):
416409

417410
# TODO: don't use exception handling for GOS polling...
418411

419-
logger.error("ThriftBackend.attempt_request: HTTPError: %s", err)
420-
421412
gos_name = TCLIServiceClient.GetOperationStatus.__name__
422413
if method.__name__ == gos_name:
423414
delay_default = (
@@ -462,7 +453,6 @@ def attempt_request(attempt):
462453
else:
463454
logger.warning(log_string)
464455
except Exception as err:
465-
logger.error("ThriftBackend.attempt_request: Exception: %s", err)
466456
error = err
467457
retry_delay = extract_retry_delay(attempt)
468458
error_message = (
@@ -952,12 +942,6 @@ def execute_command(
952942
thrift_handle,
953943
)
954944

955-
logger.debug(
956-
"ThriftBackend.execute_command(operation=%s, session_handle=%s)",
957-
operation,
958-
session_handle,
959-
)
960-
961945
spark_arrow_types = ttypes.TSparkArrowTypes(
962946
timestampAsArrow=self._use_arrow_native_timestamps,
963947
decimalAsArrow=self._use_arrow_native_decimals,

src/databricks/sql/client.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,6 @@ def read(self) -> Optional[OAuthToken]:
217217
# use_cloud_fetch
218218
# Enable use of cloud fetch to extract large query results in parallel via cloud storage
219219

220-
logger.debug(
221-
"Connection.__init__(server_hostname=%s, http_path=%s)",
222-
server_hostname,
223-
http_path,
224-
)
225-
226220
if access_token:
227221
access_token_kv = {"access_token": access_token}
228222
kwargs = {**kwargs, **access_token_kv}
@@ -298,13 +292,7 @@ def __enter__(self) -> "Connection":
298292
return self
299293

300294
def __exit__(self, exc_type, exc_value, traceback):
301-
try:
302-
self.close()
303-
except BaseException as e:
304-
logger.warning(f"Exception during connection close in __exit__: {e}")
305-
if exc_type is None:
306-
raise
307-
return False
295+
self.close()
308296

309297
def __del__(self):
310298
if self.open:
@@ -427,14 +415,7 @@ def __enter__(self) -> "Cursor":
427415
return self
428416

429417
def __exit__(self, exc_type, exc_value, traceback):
430-
try:
431-
logger.debug("Cursor context manager exiting, calling close()")
432-
self.close()
433-
except BaseException as e:
434-
logger.warning(f"Exception during cursor close in __exit__: {e}")
435-
if exc_type is None:
436-
raise
437-
return False
418+
self.close()
438419

439420
def __iter__(self):
440421
if self.active_result_set:
@@ -765,9 +746,6 @@ def execute(
765746
766747
:returns self
767748
"""
768-
logger.debug(
769-
"Cursor.execute(operation=%s, parameters=%s)", operation, parameters
770-
)
771749

772750
param_approach = self._determine_parameter_approach(parameters)
773751
if param_approach == ParameterApproach.NONE:

tests/e2e/test_driver.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
from tests.e2e.common.uc_volume_tests import PySQLUCVolumeTestSuiteMixin
5252

53-
from databricks.sql.exc import SessionAlreadyClosedError, CursorAlreadyClosedError
53+
from databricks.sql.exc import SessionAlreadyClosedError
5454

5555
log = logging.getLogger(__name__)
5656

@@ -820,6 +820,7 @@ def test_close_connection_closes_cursors(self):
820820
ars = cursor.active_result_set
821821

822822
# We must manually run this check because thrift_backend always forces `has_been_closed_server_side` to True
823+
823824
# Cursor op state should be open before connection is closed
824825
status_request = ttypes.TGetOperationStatusReq(
825826
operationHandle=ars.command_id.to_thrift_handle(),
@@ -845,6 +846,7 @@ def test_closing_a_closed_connection_doesnt_fail(self, caplog):
845846
with self.connection() as conn:
846847
# First .close() call is explicit here
847848
conn.close()
849+
848850
assert "Session appears to have been closed already" in caplog.text
849851

850852
conn = None

tests/unit/test_client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import databricks.sql
2121
import databricks.sql.client as client
2222
from databricks.sql import InterfaceError, DatabaseError, Error, NotSupportedError
23-
from databricks.sql.exc import RequestError, CursorAlreadyClosedError
2423
from databricks.sql.types import Row
2524
from databricks.sql.client import CommandId
2625

0 commit comments

Comments
 (0)