Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion dbsqlcli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def apply_credentials_from_cfg(hostname, http_path, access_token, auth_type, cfg
"""

if not cfg.get("credentials"):
return hostname, http_path, access_token
return hostname, http_path, access_token, auth_type

hostname = hostname or cfg.get("credentials", {}).get("host_name")
http_path = http_path or cfg.get("credentials", {}).get("http_path")
Expand Down
11 changes: 11 additions & 0 deletions test/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,14 @@ def test_blended_credentials_are_used():
assert http_path == HTTP_PATH
assert access_token == "dapi_configRandomAccessKey"
assert auth_type == AuthType.DATABRICKS_OAUTH.value


def test_passthrough_with_empty_config():
host_name, http_path, access_token, auth_type = apply_credentials_from_cfg(
HOST_NAME, HTTP_PATH, ACCESS_TOKEN, AuthType.DATABRICKS_OAUTH.value, {}
)

assert host_name == HOST_NAME
assert http_path == HTTP_PATH
assert access_token == ACCESS_TOKEN
assert auth_type == AuthType.DATABRICKS_OAUTH.value