fix(python, rust): properly interpret FMT_MAX_ROWS - remove arbitrary minimum, fix Series formatting #5281
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.
Some slightly OCD updates/fixes:
Fixed a few issues with use of FMT_MAX_ROWS (Rust)
Removed arbitrary minimum value:
Min value was forcibly capped at 2, due to the formatting code requiring at least one row before and one row after any
...
placeholders (which represent extant but non-displayed rows/cells); adjusted things so it properly handles 0 and 1.Not many compelling reasons to want to set such small values, but equally there are no good reasons not to allow it if somebody decides they do want to :)
Fixed
Series
formatting for certain values:Certain values of FMT_MAX_ROWS resulted in incorrect formatting (omitting a value), due to integer division shenanigans; wasn't previously noticed as the default is a small even number. Fixed the array formatting macro that calculates what to display (in addition to also handling 0 and 1 values, as above).
Example: when FMT_MAX_ROWS = 3 →
Consolidated config vars (Rust)
Noticed that there is an existing
config.rs
, but it was never updated with the newer table formatting variables; updated accordingly so we don't have a mix of bare strings and const refs.Exposed new
UTF_FULL_CONDENSED
comfy-table preset (Rust, Python)(which I added there earlier in the week to help reclaim some vertical space ;)
Misc: fixed
Expr
docstring examples forround
andtruncate
(Python)The examples in these two expressions were directly copied from
Series
instead of actually showing the relevant expressions in use; updated appropriately.