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

[#5768] improvement(CLI): improve formatted output #5770

Merged
merged 9 commits into from
Dec 7, 2024

Conversation

Abyss-lord
Copy link
Contributor

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):

image

Only change the implementation of the TableFormatImpl class, the same effect is achieved when the catalog list --output table command is supported

Why are the changes needed?

Fix: #5768

Does this PR introduce any user-facing change?

NO.

How was this patch tested?

gcli catalog details --name <catalog>  --metalake <metalake> --output table
gcli metalake details --name <metalake>  --output table
gcli metalake list --output table

pancx and others added 3 commits December 5, 2024 15:52
### 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
@Abyss-lord
Copy link
Contributor Author

@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?

@Abyss-lord
Copy link
Contributor Author

@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?

@mchades
Copy link
Contributor

mchades commented Dec 5, 2024

CI is passed now, we will review this ASAP

@mchades mchades changed the title [#5768] improvement(CLI): improve formatted output (#5768) [#5768] improvement(CLI): improve formatted output Dec 5, 2024
pancx added 3 commits December 5, 2024 17:47
Comments were added according to the Reviewer's comments
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."
@Abyss-lord Abyss-lord requested review from xunliu and mchades December 5, 2024 10:39
@xunliu
Copy link
Member

xunliu commented Dec 5, 2024

hi @Abyss-lord
This PR CI failed, Please fix it.

use  ./gradlew :clients:cli:spotlessApply  format code due to ci failed
@Abyss-lord
Copy link
Contributor Author

hi @Abyss-lord This PR CI failed, Please fix it.

done

@xunliu
Copy link
Member

xunliu commented Dec 6, 2024

hi @Abyss-lord
Can you send your email address to me? I think to discuss with you.
My email: liuxun#apache.org, Tanks!

@Abyss-lord
Copy link
Contributor Author

hi @Abyss-lord Can you send your email address to me? I think to discuss with you. My email: liuxun@apache.org, Tanks!

hi, @xunliu I just sent you an email.

@Abyss-lord
Copy link
Contributor Author

@xunliu @mchades hello guys, could you plz review this PR again?

Copy link
Member

@xunliu xunliu left a 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

@xunliu xunliu merged commit c0bdd46 into apache:main Dec 7, 2024
25 checks passed
@Abyss-lord Abyss-lord deleted the fix-output branch December 15, 2024 07:29
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

Successfully merging this pull request may close these issues.

[Improvement] Fixed the alignment problem of formatted output when the output has Chinese
3 participants