Skip to content

Enhance SEA HTTP Client #618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 19 commits into
base: ext-links-sea
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
11bc165
preliminary (robust) SEA HTTP Client
varun-edachali-dbx Jun 27, 2025
d389316
prevent catching of MaxRetryError and HttpError in client
varun-edachali-dbx Jun 27, 2025
cc48caf
formatting (black)
varun-edachali-dbx Jun 27, 2025
6a1274f
fix type annotations
varun-edachali-dbx Jun 27, 2025
ebc1915
Merge branch 'ext-links-sea' into sea-http-client
varun-edachali-dbx Jun 27, 2025
4651cd6
pass test_retry_exponential_backoff
varun-edachali-dbx Jun 30, 2025
d67eb7b
prevent parsing empty response data (get test_retry_abort_non_recover…
varun-edachali-dbx Jun 30, 2025
2caf38d
more defensive parsing, allow more method types in urllib3
varun-edachali-dbx Jun 30, 2025
3e55ddd
allow Any values in session_conf, cast to String as done in Thrift ba…
varun-edachali-dbx Jun 30, 2025
4afff39
account for max_redirects in SEA backend
varun-edachali-dbx Jun 30, 2025
01d49cd
return empty JsonQueue if no data
varun-edachali-dbx Jul 1, 2025
3d8aa7f
do not preload content?
varun-edachali-dbx Jul 2, 2025
b12a8b0
Merge branch 'ext-links-sea' into sea-http-client
varun-edachali-dbx Jul 7, 2025
51aa9be
add sea tag on large queries
varun-edachali-dbx Jul 7, 2025
3172ab8
Merge branch 'ext-links-sea' into sea-http-client
varun-edachali-dbx Jul 7, 2025
461e762
simplify error handling
varun-edachali-dbx Jul 7, 2025
fd1e6cf
stop mypy complaints
varun-edachali-dbx Jul 8, 2025
15378de
run retry tests
varun-edachali-dbx Jul 8, 2025
83de7d9
Merge branch 'ext-links-sea' into sea-http-client
varun-edachali-dbx Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/databricks/sql/auth/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import typing
from importlib.metadata import version
from enum import Enum
from typing import List, Optional, Tuple, Union
from typing import Any, List, Optional, Tuple, Union

import urllib3

Expand Down Expand Up @@ -123,15 +123,15 @@ def __init__(
_total: int = urllib3_kwargs.pop("total")
_attempts_remaining = _total

_urllib_kwargs_we_care_about = dict(
_urllib_kwargs_we_care_about: dict[str, Any] = dict(
total=_attempts_remaining,
respect_retry_after_header=True,
backoff_factor=self.delay_min,
allowed_methods=["POST"],
status_forcelist=[429, 503, *self.force_dangerous_codes],
)

urllib3_kwargs.update(**_urllib_kwargs_we_care_about)
_urllib_kwargs_we_care_about.update(**urllib3_kwargs)
urllib3_kwargs = _urllib_kwargs_we_care_about

super().__init__(
**urllib3_kwargs,
Expand Down
6 changes: 3 additions & 3 deletions src/databricks/sql/backend/sea/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@


def _filter_session_configuration(
session_configuration: Optional[Dict[str, str]]
session_configuration: Optional[Dict[str, Any]]
) -> Optional[Dict[str, str]]:
if not session_configuration:
return None
Expand All @@ -59,7 +59,7 @@ def _filter_session_configuration(

for key, value in session_configuration.items():
if key.upper() in ALLOWED_SESSION_CONF_TO_DEFAULT_VALUES_MAP:
filtered_session_configuration[key.lower()] = value
filtered_session_configuration[key.lower()] = str(value)
else:
ignored_configs.add(key)

Expand Down Expand Up @@ -183,7 +183,7 @@ def max_download_threads(self) -> int:

def open_session(
self,
session_configuration: Optional[Dict[str, str]],
session_configuration: Optional[Dict[str, Any]],
catalog: Optional[str],
schema: Optional[str],
) -> SessionId:
Expand Down
Loading
Loading