Skip to content

Commit 5ae9d7c

Browse files
committed
Clarify SEA pool migration and test failed connection cleanup
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
1 parent 18488ea commit 5ae9d7c

3 files changed

Lines changed: 20 additions & 12 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Unreleased
44
- **Breaking:** Remove the deprecated pure-Python SEA backend and its options; use Thrift (default) or `use_kernel=True`.
55
- **Breaking:** Kernel IDs now use `BackendType.KERNEL`, `SessionId.from_kernel_session_id`, and `CommandId.from_kernel_statement_id`. Remove `BackendType.SEA`, the `from_sea_*` / `to_sea_*` helpers, `CommandState.from_sea_state`, and `DatabricksClientType.SEA`.
6-
- Warn when removed SEA options are passed; replace `max_connections` with `_pool_maxsize`.
6+
- Warn when removed SEA options are passed. On kernel ≥ 1.1.0, use `_pool_maxsize` for the kernel HTTP pool; it does not configure the Thrift query transport.
77

88
# 4.9.0 (2026-11-04)
99
- Upgrade Databricks SQL Kernel to 1.4.0, which keeps Lakehouse Real-Time session affinity and flushes shared telemetry only after the final session closes.

‎src/databricks/sql/client.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ def read(self) -> Optional[OAuthToken]:
383383
kwargs.pop("max_connections")
384384
logger.warning(
385385
"Parameter 'max_connections' was removed with the SEA backend "
386-
"and is ignored. Use '_pool_maxsize' instead."
386+
"and is ignored. On kernel >= 1.1.0, use '_pool_maxsize' for the "
387+
"kernel HTTP pool; it does not configure the Thrift query transport."
387388
)
388389

389390
logger.debug(

‎tests/unit/test_session.py‎

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@ class TestSession:
3939
def test_removed_sea_backend_rejected_before_connecting(
4040
self, mock_session, mock_http_client, use_kernel
4141
):
42-
with pytest.raises(
43-
ValueError, match="SEA backend has been removed.*use_kernel=True"
44-
):
45-
databricks.sql.connect(
46-
**self.DUMMY_CONNECTION_ARGS, use_sea=True, use_kernel=use_kernel
47-
)
42+
gc.collect()
43+
with patch("sys.unraisablehook") as unraisable_hook:
44+
with pytest.raises(
45+
ValueError, match="SEA backend has been removed.*use_kernel=True"
46+
):
47+
databricks.sql.connect(
48+
**self.DUMMY_CONNECTION_ARGS, use_sea=True, use_kernel=use_kernel
49+
)
50+
gc.collect()
51+
unraisable_hook.assert_not_called()
4852
mock_session.assert_not_called()
4953
mock_http_client.assert_not_called()
5054

@@ -56,12 +60,12 @@ def test_removed_sea_backend_rejected_before_connecting(
5660
({"use_sea": False}, None),
5761
({"use_hybrid_disposition": False}, None),
5862
({"use_hybrid_disposition": True}, "use_hybrid_disposition"),
59-
({"max_connections": 10}, "Use '_pool_maxsize' instead."),
60-
({"max_connections": 0}, "Use '_pool_maxsize' instead."),
61-
({"max_connections": None}, "Use '_pool_maxsize' instead."),
63+
({"max_connections": 10}, "max_connections"),
64+
({"max_connections": 0}, "max_connections"),
65+
({"max_connections": None}, "max_connections"),
6266
(
6367
{"max_connections": 10, "_pool_maxsize": 42},
64-
"Use '_pool_maxsize' instead.",
68+
"max_connections",
6569
),
6670
],
6771
)
@@ -93,6 +97,9 @@ def test_removed_backend_options_warn_and_are_not_forwarded(
9397
if expected_warning:
9498
assert len(messages) == 1
9599
assert expected_warning in messages[0]
100+
if expected_warning == "max_connections":
101+
assert "On kernel >= 1.1.0, use '_pool_maxsize'" in messages[0]
102+
assert "does not configure the Thrift query transport" in messages[0]
96103
else:
97104
assert messages == []
98105

0 commit comments

Comments
 (0)