Skip to content

Commit 07cb5fd

Browse files
committed
Fixed linting issues
Signed-off-by: Nikhil Suri <[email protected]>
1 parent f02b08a commit 07cb5fd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/databricks/sql/common/feature_flag.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/databricks/sql/common/url_utils.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,26 @@
66
def 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

0 commit comments

Comments
 (0)