markhoerth / dremio_client

Apache License 2.0
31 stars 25 forks source link

Fixed a small bug where -p is used for the port and the password. #183

Closed drivard closed 3 years ago

drivard commented 3 years ago

Fixed a small bug where -p is used for the port and the password at the global command line options.

The behaviour was that only the password was filled in the argument of the cli function.

codecov[bot] commented 3 years ago

Codecov Report

Merging #183 (8e8be85) into master (d4573e4) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #183   +/-   ##
=======================================
  Coverage   52.91%   52.91%           
=======================================
  Files          24       24           
  Lines        1595     1595           
=======================================
  Hits          844      844           
  Misses        751      751           
Impacted Files Coverage Δ
dremio_client/cli.py 53.62% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d4573e4...8e8be85. Read the comment docs.

rymurr commented 3 years ago

Thanks a lot for the contribution @drivard! That indeed should be fixed. I am wondering if instead we just remove the -p option from password. I think -p is very standard for port on a cli but its not overly common to specify the password that way. What do you think?

drivard commented 3 years ago

We can remove the -p or I can try -P for port if it is case sensitive.

drivard commented 3 years ago

Tested it using the vscode debugger. -P is case sensitive, therefore if we use it for let say password assignment it would set the proper value.

image

The debbuging command line used was:

"configurations": [
        {
            "name": "Python: Dremio Client",
            "type": "python",
            "request": "launch",
            "cwd": "${workspaceFolder}",
            "module": "dremio_client.cli",
            "args": [
                "-h",
                "dremio.example.com",
                "-p",
                "443",
                "-u",
                "admin",
                "-P",
                "P4ssW0rd",
                "--ssl",
                "sql",
                "select * from sys.options",
            ]
        }
    ]
drivard commented 3 years ago

I have adjusted the PR with -p for the port and -P for the password.

rymurr commented 3 years ago

I will cut a new release soon and add you to the CONTRIBUTORS list. Thanks @drivard