-
Notifications
You must be signed in to change notification settings - Fork 383
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
[#5827] improvement(CLI): Fix CLI throws an obscure error when Delete a table with a missing table name #5906
Conversation
fdc2b8c
to
e2e6da1
Compare
hi @justinmclean @xunliu , Could you please take a look when you have time? |
e2e6da1
to
a66d932
Compare
clients/cli/src/test/java/org/apache/gravitino/cli/TestTableCommands.java
Show resolved
Hide resolved
You can use |
Fix cli throws an obscure error when Delete a table with a missing table name.it should give clearer hints.
add some test case to test whether the command fuse is executed correctly
This reverts commit fdc2b8c.
20b5058
to
f06af4f
Compare
thank you, @justinmclean plz review this again |
Is this the current output?
If so, the first two errors are not entirely correct, and they are missing the table name as well. It is also not really missing an argument just part of one. |
add some test case to test whether the command fuse is executed correctly
fix error message and test case.
fix, thank you |
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java
Outdated
Show resolved
Hide resolved
fix check null expression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making these changes.
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java
Outdated
Show resolved
Hide resolved
fix ci fail and change the error message.
move handling of LIST command "back" to the switch case and fix the test case.
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java
Outdated
Show resolved
Hide resolved
clients/cli/src/main/java/org/apache/gravitino/cli/GravitinoCommandLine.java
Outdated
Show resolved
Hide resolved
clients/cli/src/test/java/org/apache/gravitino/cli/TestTableCommands.java
Outdated
Show resolved
Hide resolved
This reverts commit 509e411.
fix test case and list logic
Hi @justinmclean , I’ve finished updating the code. Please take a look at the PR again when you have time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks
…Delete a table with a missing table name (apache#5906) ### What changes were proposed in this pull request? Fix CLI throws an obscure error when Delete a table with a missing table name.it should give clearer hints. ### Why are the changes needed? Fix: apache#5827 ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? #### local bash test ```bash bin/gcli.sh table delete --metalake demo_metalake Missing required argument(s): catalog, schema, table bin/gcli.sh table delete --metalake demo_metalake --name Hive_catalog # output: Missing required argument(s): schema, table bin/gcli.sh table delete --metalake demo_metalake --name Hive_catalog.default # output: Missing required argument(s): table bin/gcli.sh table details --metalake demo_metalake --name Hive_catalog.default # output # Malformed entity name. # Missing required argument(s): table ``` #### Unit test add some test case to test whether the command fuse is executed correctly.
… methods (#5972) ### What changes were proposed in this pull request? refactor the validation logic of all entities and add test case, just like validation of table command #5906 . A hint is provided when the user's output is missing the required arguments. for example: ```bash gcli column list -m demo_metalake, --name Hive_catalog # Malformed entity name. # Missing required argument(s): schema, table gcli column details -m demo_metalake, --name Hive_catalog --audit # Malformed entity name. # Missing required argument(s): schema, table, column gcli user delete -m demo_metalake Missing --user option. ``` Currently, the Role command needs to be refactored and opened as a separate issue ### Why are the changes needed? Fix: #5861 ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? local test
…Delete a table with a missing table name (apache#5906) ### What changes were proposed in this pull request? Fix CLI throws an obscure error when Delete a table with a missing table name.it should give clearer hints. ### Why are the changes needed? Fix: apache#5827 ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? #### local bash test ```bash bin/gcli.sh table delete --metalake demo_metalake Missing required argument(s): catalog, schema, table bin/gcli.sh table delete --metalake demo_metalake --name Hive_catalog # output: Missing required argument(s): schema, table bin/gcli.sh table delete --metalake demo_metalake --name Hive_catalog.default # output: Missing required argument(s): table bin/gcli.sh table details --metalake demo_metalake --name Hive_catalog.default # output # Malformed entity name. # Missing required argument(s): table ``` #### Unit test add some test case to test whether the command fuse is executed correctly.
…handle methods (apache#5972) ### What changes were proposed in this pull request? refactor the validation logic of all entities and add test case, just like validation of table command apache#5906 . A hint is provided when the user's output is missing the required arguments. for example: ```bash gcli column list -m demo_metalake, --name Hive_catalog # Malformed entity name. # Missing required argument(s): schema, table gcli column details -m demo_metalake, --name Hive_catalog --audit # Malformed entity name. # Missing required argument(s): schema, table, column gcli user delete -m demo_metalake Missing --user option. ``` Currently, the Role command needs to be refactored and opened as a separate issue ### Why are the changes needed? Fix: apache#5861 ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? local test
What changes were proposed in this pull request?
Fix CLI throws an obscure error when Delete a table with a missing table name.it should give clearer hints.
Why are the changes needed?
Fix: #5827
Does this PR introduce any user-facing change?
NO
How was this patch tested?
local bash test
Unit test
add some test case to test whether the command fuse is executed correctly.