Skip to content

Commit cc2179f

Browse files
fix: reuse shared host normalization in Thrift backend
Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
1 parent 34c6d00 commit cc2179f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎src/databricks/sql/backend/thrift_backend.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from uuid import UUID
1010

1111
from databricks.sql.common.unified_http_client import UnifiedHttpClient
12+
from databricks.sql.common.url_utils import normalize_host_with_protocol
1213
from databricks.sql.result_set import ThriftResultSet
1314
from databricks.sql.telemetry.models.event import StatementType
1415

@@ -156,10 +157,10 @@ def __init__(
156157
uri = kwargs.get("_connection_uri")
157158
elif server_hostname and http_path:
158159
uri = "{host}:{port}/{path}".format(
159-
host=server_hostname.rstrip("/"), port=port, path=http_path.lstrip("/")
160+
host=normalize_host_with_protocol(server_hostname),
161+
port=port,
162+
path=http_path.lstrip("/"),
160163
)
161-
if not uri.lower().startswith("https://"):
162-
uri = "https://" + uri
163164
else:
164165
raise ValueError("No valid connection settings.")
165166

0 commit comments

Comments
 (0)