Skip to content
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

auth_type parameter not optional #45

Open
jlenczuk-ckd opened this issue Apr 3, 2023 · 3 comments
Open

auth_type parameter not optional #45

jlenczuk-ckd opened this issue Apr 3, 2023 · 3 comments

Comments

@jlenczuk-ckd
Copy link

Hi,

I have updated databricks-sql-cli to version 0.3.0. Now my authentication details - host name, HTTP path and access token - fail when I pass them directly to the command line. I get the following error:
image

It seems that there is one argument missing, mainly the auth_type. However, the following code suggests that in case credentials key cannot be found in the conf file, apply_credentials_from_cfg should return 3 values. In other cases, it returns 4 values.

def apply_credentials_from_cfg(hostname, http_path, access_token, auth_type, cfg):

DBSQLCli class on the other hand, always tries to unpack 4 values coming from the apply_credentials_from_cfg function. This fails in my case, as I don't pass the auth_type and therefore I only have 3 values returned by the function.

hostname, http_path, access_token, auth_type = apply_credentials_from_cfg(

Did I understand it correctly and could you please provide any suggestions?

@naveen-arumugam
Copy link

Facing the same issue; any suggestions?

@naveen-arumugam
Copy link

naveen-arumugam commented May 19, 2023

It works if auth_type is added to the credentials check; not elegant, but works. Any suggestion?

https://github.com/databricks/databricks-sql-cli/blob/345ca09bcf602b45755a6137af5e83f9e673272f/dbsqlcli/main.py#LL67C24-L67C24
return hostname, http_path, access_token
changing the above with auth_type makes the dbsqlcli to work
return hostname, http_path, access_token, auth_type

Also, this fails (suggesting that this file ~/.dbsqlcli/dbsqlclirc is ignored?)

dbsqlcli -e "SELECT 1"
'NoneType' object has no attribute 'startswith'

This works

dbsqlcli -e "SELECT 1" \
--hostname "databricks_host" \
--http-path "databricks_http_path" \
--access-token "databricks_pat" 
1
1

@naveen-arumugam
Copy link

do we've plan to add "-f" flag for SQL files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants