Skip to content

Commit faa36ab

Browse files
refactor(kernel): pass HTTP/2 options to the native session
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
1 parent 449e23e commit faa36ab

5 files changed

Lines changed: 2 additions & 16 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Release History
22

33
# Unreleased
4-
- Add kernel-only `enable_http2`: HTTPS negotiates HTTP/2 with HTTP/1.1 fallback; set `enable_http2=False` to force HTTP/1.1 for all kernel-owned HTTPS traffic. Explicit settings require a kernel wheel with HTTP/2 configuration support.
4+
- Add kernel-only `enable_http2`: HTTPS negotiates HTTP/2 with HTTP/1.1 fallback; set `enable_http2=False` to force HTTP/1.1 for all kernel-owned HTTPS traffic.
55
- Honor `max_download_threads` on kernel connections, with a default download window of 16 and explicit chunk-setting overrides. Invalid values raise `ValueError` when connecting with `use_kernel=True`.
66
- Fix the kernel backend ignoring `use_cloud_fetch=False`, so complete results can be fetched without cloud-storage downloads.
77
- Fix inline parameters (`use_inline_params=True`) so a sequence directly after `IN` renders as a list again: `x IN %(ids)s` renders as `x IN (1,2,3)` instead of `x IN ARRAY(1,2,3)`, which Spark rejects. Inside the list, tuples render as rows for a multi-column `IN`, and a `set` or `frozenset` is accepted again. Sequences anywhere else still render as `ARRAY(...)` ([#629](https://github.com/databricks/databricks-sql-python/issues/629))

‎README.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ Install using `pip install databricks-sql-connector[pyarrow]`
3939
The kernel negotiates HTTP/2 for HTTPS requests, with HTTP/1.1 fallback when the
4040
peer does not support HTTP/2. Pass `enable_http2=False` with `use_kernel=True` to
4141
force HTTP/1.1 for authentication, SQL requests, result downloads, and telemetry.
42-
This setting requires a kernel wheel with HTTP/2 configuration support.
4342

4443
Install using `pip install databricks-sql-connector[kernel]`
4544

‎src/databricks/sql/backend/kernel/client.py‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,6 @@ def _kernel_http2_kwargs(value: Optional[bool]) -> Dict[str, bool]:
223223
return {}
224224
if not isinstance(value, bool):
225225
raise ValueError("enable_http2 must be a bool")
226-
if not _kernel_session_accepts_kwarg("enable_http2"):
227-
raise NotSupportedError(
228-
"enable_http2 requires a databricks-sql-kernel wheel with HTTP/2 configuration support."
229-
)
230226
return {"enable_http2": value}
231227

232228

‎src/databricks/sql/client.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ def __init__(
197197
Kernel backend only. Negotiate HTTP/2 for HTTPS requests, with
198198
HTTP/1.1 fallback when the peer does not support HTTP/2. Set
199199
``False`` to force HTTP/1.1 for authentication, SQL requests,
200-
result downloads, and telemetry. Requires a kernel wheel with
201-
HTTP/2 configuration support.
200+
result downloads, and telemetry.
202201
:param enable_geospatial_support: `bool`, optional (default is False)
203202
Kernel backend only. Controls the public representation of
204203
``GEOMETRY`` and ``GEOGRAPHY`` result values. ``True`` returns

‎tests/unit/test_kernel_client.py‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -438,14 +438,6 @@ def test_http2_option_rejects_non_boolean(value):
438438
kernel_client._kernel_http2_kwargs(value)
439439

440440

441-
def test_http2_option_rejects_unsupported_kernel(monkeypatch):
442-
monkeypatch.setattr(kernel_client._kernel, "Session", lambda *, host: None)
443-
assert kernel_client._kernel_http2_kwargs(None) == {}
444-
for enabled in [True, False]:
445-
with pytest.raises(kernel_client.NotSupportedError, match="HTTP/2"):
446-
kernel_client._kernel_http2_kwargs(enabled)
447-
448-
449441
@pytest.mark.parametrize("timeout", [None, 0, 12.5])
450442
def test_open_session_passes_request_timeout_to_kernel(monkeypatch, timeout):
451443
captured = {}

0 commit comments

Comments
 (0)