Idea: Use one-char ellipsis symbol in more places #738
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In print_table() and print_html(), when the column width exceeds the
max_column_width
, the ellipsis symbol factors into thatmax_column
size. The three letters of a normal ellipsis are kinda bulky, especially when we have small max sizes like here: wireservice/csvkit#941There's a few things we can do!
As the author suggests, make the ellipsis char a parameter. Might not be necessary to expose to the user. They'd probably just toggle it off?
As the reviewer suggests, make the
max_precision
customizable. This might not fix the issue, sinceprint_table
will still chop off the more precise value to insert the ellipsis charactersGive "use_ellipsis", or "truncate_decimals" as a passed-in parameter. When it's false, we don't use the ellipsis in decimals. (I'm guessing non-decimals would need the ellipsis all the time?). This requires a bit more work with decimal parsing, but is totally possible
(This diff) Use the one-char ellipsis in
print_table
andprint_html
. This is the simplest way to fix the readability in the issue above, so I chose it. It's also already used in "utils" so hooray for consistency?