Skip to content

Commit 23cc72a

Browse files
formatting (black)
as in CONTRIBUTING.md Signed-off-by: varun-edachali-dbx <[email protected]>
1 parent c63f6fd commit 23cc72a

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

src/databricks/sql/client.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,13 @@ def read(self) -> Optional[OAuthToken]:
235235
catalog,
236236
schema,
237237
_use_arrow_native_complex_types,
238-
**kwargs
238+
**kwargs,
239+
)
240+
241+
logger.info(
242+
"Successfully opened connection with session "
243+
+ str(self.get_session_id_hex())
239244
)
240-
241-
logger.info("Successfully opened connection with session " + str(self.get_session_id_hex()))
242245

243246
self.use_inline_params = self._set_use_inline_params_with_warning(
244247
kwargs.get("use_inline_params", False)

src/databricks/sql/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ def __init__(
2626
) -> None:
2727
"""
2828
Create a session to a Databricks SQL endpoint or a Databricks cluster.
29-
29+
3030
This class handles all session-related behavior and communication with the backend.
3131
"""
3232
self.open = False
3333
self.host = server_hostname
3434
self.port = kwargs.get("_port", 443)
35-
35+
3636
auth_provider = get_python_sql_connector_auth_provider(
3737
server_hostname, **kwargs
3838
)
@@ -143,4 +143,4 @@ def close(self) -> None:
143143
except Exception as e:
144144
logger.error(f"Attempt to close session raised a local exception: {e}")
145145

146-
self.open = False
146+
self.open = False

tests/unit/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_closing_result_set_hard_closes_commands(self):
146146
mock_session = Mock()
147147
mock_session.open = True
148148
type(mock_connection).session = PropertyMock(return_value=mock_session)
149-
149+
150150
result_set = client.ResultSet(
151151
mock_connection, mock_results_response, mock_thrift_backend
152152
)

tests/unit/test_session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class SessionTestSuite(unittest.TestCase):
1313
"""
14-
Unit tests for Session functionality
14+
Unit tests for Session functionality
1515
"""
1616

1717
PACKAGE_NAME = "databricks.sql"
@@ -184,4 +184,4 @@ def test_finalizer_closes_abandoned_connection(self, mock_client_class):
184184

185185

186186
if __name__ == "__main__":
187-
unittest.main()
187+
unittest.main()

tests/unit/test_thrift_backend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ def test_make_request_checks_thrift_status_code(self):
8686

8787
def _make_type_desc(self, type):
8888
return ttypes.TTypeDesc(
89-
types=[ttypes.TTypeEntry(primitiveEntry=ttypes.TPrimitiveTypeEntry(type=type))]
89+
types=[
90+
ttypes.TTypeEntry(primitiveEntry=ttypes.TPrimitiveTypeEntry(type=type))
91+
]
9092
)
9193

9294
def _make_fake_thrift_backend(self):

0 commit comments

Comments
 (0)