Skip to content

Commit a888dd6

Browse files
remove excess logs, assertions, instantiations
large merge artifacts Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent f7be10c commit a888dd6

File tree

4 files changed

+2
-45
lines changed

4 files changed

+2
-45
lines changed

src/databricks/sql/backend/thrift_backend.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -946,24 +946,6 @@ def execute_command(
946946
thrift_handle,
947947
)
948948

949-
logger.debug(
950-
"ThriftBackend.execute_command(operation=%s, session_handle=%s)",
951-
operation,
952-
thrift_handle,
953-
)
954-
955-
logger.debug(
956-
"ThriftBackend.execute_command(operation=%s, session_handle=%s)",
957-
operation,
958-
session_handle,
959-
)
960-
961-
logger.debug(
962-
"ThriftBackend.execute_command(operation=%s, session_handle=%s)",
963-
operation,
964-
session_handle,
965-
)
966-
967949
spark_arrow_types = ttypes.TSparkArrowTypes(
968950
timestampAsArrow=self._use_arrow_native_timestamps,
969951
decimalAsArrow=self._use_arrow_native_decimals,

src/databricks/sql/client.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ def read(self) -> Optional[OAuthToken]:
232232
self.use_cloud_fetch = kwargs.get("use_cloud_fetch", True)
233233
self._cursors = [] # type: List[Cursor]
234234

235-
# Create the session
236235
self.session = Session(
237236
server_hostname,
238237
http_path,
@@ -245,23 +244,6 @@ def read(self) -> Optional[OAuthToken]:
245244
)
246245
self.session.open()
247246

248-
logger.info(
249-
"Successfully opened connection with session "
250-
+ str(self.get_session_id_hex())
251-
)
252-
253-
# Create the session
254-
self.session = Session(
255-
server_hostname,
256-
http_path,
257-
http_headers,
258-
session_configuration,
259-
catalog,
260-
schema,
261-
_use_arrow_native_complex_types,
262-
**kwargs
263-
)
264-
265247
self.use_inline_params = self._set_use_inline_params_with_warning(
266248
kwargs.get("use_inline_params", False)
267249
)

src/databricks/sql/session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def __init__(
8484
**kwargs,
8585
)
8686

87+
self.protocol_version = None
88+
8789
def open(self):
8890
self._session_id = self.backend.open_session(
8991
session_configuration=self.session_configuration,

tests/unit/test_client.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,6 @@ def test_context_manager_closes_cursor(self):
218218
finally:
219219
cursor.close.assert_called()
220220

221-
connection = databricks.sql.connect(**self.DUMMY_CONNECTION_ARGS)
222-
connection.close = Mock()
223-
try:
224-
with self.assertRaises(KeyboardInterrupt):
225-
with connection:
226-
raise KeyboardInterrupt("Simulated interrupt")
227-
finally:
228-
connection.close.assert_called()
229-
230221
def dict_product(self, dicts):
231222
"""
232223
Generate cartesion product of values in input dictionary, outputting a dictionary

0 commit comments

Comments
 (0)