-
Notifications
You must be signed in to change notification settings - Fork 416
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
[#5768] improvement(CLI): improve formatted output #5770
Conversation
### What changes were proposed in this pull request? Enhance the Gravitino CLI with formatted output.Fixed the alignment problem of formatted output when the output has Chinese. ### Why are the changes needed? improvement: apache#5768 Cause bounding boxes are not properly aligned when the output has Chinese characters ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? ```shell gcli catalog details --name <catalog> --metalake <metalake> --output table gcli metalake details --name <metalake> --output table gcli metalake list --output table ```
Change it table format output test, add chinese comments when creating catalog
@xunliu I’m new to this project and would greatly appreciate your help reviewing this PR. Could you please take a look when you have time? Thank you so much for your guidance! if possible, could you grant me the necessary permissions to run workflows? |
@mchades I’m new to this project and would greatly appreciate your help reviewing this PR. Could you please take a look when you have time? Thank you so much for your guidance! if possible, could you grant me the necessary permissions to run workflows? |
CI is passed now, we will review this ASAP |
clients/cli/src/main/java/org/apache/gravitino/cli/outputs/TableFormat.java
Show resolved
Hide resolved
clients/cli/src/test/java/org/apache/gravitino/cli/integration/test/TableFormatOutputIT.java
Outdated
Show resolved
Hide resolved
clients/cli/src/test/java/org/apache/gravitino/cli/integration/test/TableFormatOutputIT.java
Outdated
Show resolved
Hide resolved
Comments were added according to the Reviewer's comments
This reverts commit 067df11.
Modify the test based on the code review comments, and add a new test method to verify the table output when the catalog comment contains Chinese characters."
hi @Abyss-lord |
use ./gradlew :clients:cli:spotlessApply format code due to ci failed
done |
hi @Abyss-lord |
hi, @xunliu I just sent you an email. |
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.
@Abyss-lord Thank you for your contributions.
LGTM
What changes were proposed in this pull request?
Enhanced the Gravitino CLI to support properly formatted output. Fixed alignment issues in formatted output when it includes Chinese characters.
The bounding box length calculation is now based on the number of characters rather than the character display width . The correct output should look like this(Here are the results of my local tests):
Only change the implementation of the TableFormatImpl class, the same effect is achieved when the
catalog list --output table
command is supportedWhy are the changes needed?
Fix: #5768
Does this PR introduce any user-facing change?
NO.
How was this patch tested?