Skip to content

Commit a5561e8

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 <varun.edachali@databricks.com>
1 parent 2d24fdd commit a5561e8

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
@@ -134,13 +134,6 @@ def __init__(
134134
# max_download_threads
135135
# Number of threads for handling cloud fetch downloads. Defaults to 10
136136

137-
logger.debug(
138-
"ThriftBackend.__init__(server_hostname=%s, port=%s, http_path=%s)",
139-
server_hostname,
140-
port,
141-
http_path,
142-
)
143-
144137
port = port or 443
145138
if kwargs.get("_connection_uri"):
146139
uri = kwargs.get("_connection_uri")
@@ -412,8 +405,6 @@ def attempt_request(attempt):
412405

413406
# TODO: don't use exception handling for GOS polling...
414407

415-
logger.error("ThriftBackend.attempt_request: HTTPError: %s", err)
416-
417408
gos_name = TCLIServiceClient.GetOperationStatus.__name__
418409
if method.__name__ == gos_name:
419410
delay_default = (
@@ -458,7 +449,6 @@ def attempt_request(attempt):
458449
else:
459450
logger.warning(log_string)
460451
except Exception as err:
461-
logger.error("ThriftBackend.attempt_request: Exception: %s", err)
462452
error = err
463453
retry_delay = extract_retry_delay(attempt)
464454
error_message = (
@@ -946,12 +936,6 @@ def execute_command(
946936
thrift_handle,
947937
)
948938

949-
logger.debug(
950-
"ThriftBackend.execute_command(operation=%s, session_handle=%s)",
951-
operation,
952-
session_handle,
953-
)
954-
955939
spark_arrow_types = ttypes.TSparkArrowTypes(
956940
timestampAsArrow=self._use_arrow_native_timestamps,
957941
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}
@@ -297,13 +291,7 @@ def __enter__(self) -> "Connection":
297291
return self
298292

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

308296
def __del__(self):
309297
if self.open:
@@ -426,14 +414,7 @@ def __enter__(self) -> "Cursor":
426414
return self
427415

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

438419
def __iter__(self):
439420
if self.active_result_set:
@@ -764,9 +745,6 @@ def execute(
764745
765746
:returns self
766747
"""
767-
logger.debug(
768-
"Cursor.execute(operation=%s, parameters=%s)", operation, parameters
769-
)
770748

771749
param_approach = self._determine_parameter_approach(parameters)
772750
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.result_set import ResultSet, ThriftResultSet
2625

0 commit comments

Comments
 (0)