File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
src/databricks/sql/common Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,8 @@ def __init__(
6868
6969 endpoint_suffix = FEATURE_FLAGS_ENDPOINT_SUFFIX_FORMAT .format (__version__ )
7070 self ._feature_flag_endpoint = (
71- normalize_host_with_protocol (self ._connection .session .host ) + endpoint_suffix
71+ normalize_host_with_protocol (self ._connection .session .host )
72+ + endpoint_suffix
7273 )
7374
7475 # Use the provided HTTP client
Original file line number Diff line number Diff line change 66def normalize_host_with_protocol (host : str ) -> str :
77 """
88 Normalize a connection hostname by ensuring it has a protocol and removing trailing slashes.
9-
9+
1010 This is useful for handling cases where users may provide hostnames with or without protocols
1111 (common with dbt-databricks users copying URLs from their browser).
12-
12+
1313 Args:
1414 host: Connection hostname which may or may not include a protocol prefix (https:// or http://)
1515 and may or may not have a trailing slash
16-
16+
1717 Returns:
1818 Normalized hostname with protocol prefix and no trailing slash
19-
19+
2020 Examples:
2121 normalize_host_with_protocol("myserver.com") -> "https://myserver.com"
2222 normalize_host_with_protocol("https://myserver.com") -> "https://myserver.com"
2323 """
2424 # Remove trailing slash
2525 host = host .rstrip ("/" )
26-
26+
2727 # Add protocol if not present
2828 if not host .startswith ("https://" ) and not host .startswith ("http://" ):
2929 host = f"https://{ host } "
30-
31- return host
3230
31+ return host
You can’t perform that action at this time.
0 commit comments