Skip to content

Commit 11aae78

Browse files
Warn that the SEA backend is incomplete and steer users to the kernel path
The SEA backend (use_sea=True) has feature gaps — notably it does not support positional (`?`) parameter binding, which causes HTTP 400s against RT/Lakehouse warehouses. Rather than partially patch SEA, emit a warning at SeaDatabricksClient construction telling users to use the supported kernel backend (use_kernel=True) and install the `[kernel]` extra. The SEA path stays functional (RT warehouses refuse Thrift, so it can't simply be rerouted) and is slated for eventual deprecation. Co-authored-by: Isaac Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>
1 parent 0a8f1d2 commit 11aae78

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

src/databricks/sql/backend/sea/backend.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ def __init__(
151151
http_path,
152152
)
153153

154+
# The SEA backend is incomplete (e.g. it does not support positional
155+
# parameter binding) and is slated for deprecation. Steer users to the
156+
# Rust kernel backend, which is the supported path.
157+
logger.warning(
158+
"The SEA backend (use_sea=True) is incomplete and should not be "
159+
"used in production; it will eventually be deprecated. Use the "
160+
"kernel backend instead by passing use_kernel=True and installing "
161+
"the kernel extra: pip install 'databricks-sql-connector[kernel]'."
162+
)
163+
154164
self._max_download_threads = kwargs.get("max_download_threads", 10)
155165
self._ssl_options = ssl_options
156166
self._use_arrow_native_complex_types = kwargs.get(

tests/unit/test_sea_backend.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,30 @@ def test_initialization(self, mock_http_client):
200200
)
201201
assert "Could not extract warehouse ID" in str(excinfo.value)
202202

203+
def test_initialization_warns_backend_incomplete(self, mock_http_client, caplog):
204+
"""Constructing a SEA client emits a warning steering users to the
205+
kernel backend, since the SEA path is incomplete and slated for
206+
deprecation."""
207+
import logging
208+
209+
with caplog.at_level(
210+
logging.WARNING, logger="databricks.sql.backend.sea.backend"
211+
):
212+
SeaDatabricksClient(
213+
server_hostname="test-server.databricks.com",
214+
port=443,
215+
http_path="/sql/warehouses/abc123",
216+
http_headers=[],
217+
auth_provider=AuthProvider(),
218+
ssl_options=SSLOptions(),
219+
)
220+
221+
warnings = [r.message for r in caplog.records if r.levelno == logging.WARNING]
222+
assert any(
223+
"incomplete" in m and "use_kernel=True" in m and "[kernel]" in m
224+
for m in warnings
225+
), warnings
226+
203227
def test_session_management(self, sea_client, mock_http_client, thrift_session_id):
204228
"""Test session management methods."""
205229
# Test open_session with minimal parameters

0 commit comments

Comments
 (0)