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

Fix lakectl table write to non tty non string column #5500

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

nopcoder
Copy link
Contributor

Fix #5433

@nopcoder nopcoder added bug Something isn't working area/lakectl Issues related to lakeFS' command line interface (lakectl) include-changelog PR description should be included in next release changelog labels Mar 15, 2023
@nopcoder nopcoder self-assigned this Mar 15, 2023
Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Not sure this is specifically related to tty output.)

Thanks!

@@ -151,7 +151,7 @@ func WriteTo(tpl string, data interface{}, w io.Writer) {
var b strings.Builder
for _, row := range tab.Rows {
for ic, cell := range row {
b.WriteString(fmt.Sprintf("%s", cell))
b.WriteString(fmt.Sprintf("%v", cell))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use just fmt.Sprint? (Should we, given the danger of format during confusion?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll split the format and write. The Sprintf will render a single cell value - but in order to concat full table content I'm using strings.Builder.

@nopcoder
Copy link
Contributor Author

(Not sure this is specifically related to tty output.)

Thanks!

The non-tty is related to the fact that we use this code while render the table when we identify that the output is not the terminal.

@nopcoder nopcoder enabled auto-merge (squash) March 16, 2023 07:08
@nopcoder nopcoder merged commit 68f5dcf into master Mar 16, 2023
@nopcoder nopcoder deleted the fix/lakectl-table branch March 16, 2023 07:35
nopcoder added a commit that referenced this pull request Mar 20, 2023
* Fix lakectl table write to non tty non string column

* split cell fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/lakectl Issues related to lakeFS' command line interface (lakectl) bug Something isn't working include-changelog PR description should be included in next release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output of lakectl auth groups policies list includes erroneous %!s(int=0)
2 participants