Skip to content

Honor disable_numparse when wrapping columns with maxcolwidths - #473

Open
ekanshul wants to merge 1 commit into
astanin:masterfrom
ekanshul:fix-428-disable-numparse-wrap
Open

ekanshul wants to merge 1 commit into
astanin:masterfrom
ekanshul:fix-428-disable-numparse-wrap

Conversation

@ekanshul

Copy link
Copy Markdown

Fixes #428.

disable_numparse=True was ignored on the maxcolwidths wrap path, so values like '80,443' crashed with ValueError: invalid literal for int().

_wrap_text_to_colwidths passed the per-cell numparse flag to _type positionally:

str(_type(cell, numparse)(cell))

_type's signature is _type(string, has_invisible=True, numparse=True), so False filled has_invisible and numparse stayed True. This is a regression of the #305 / #362 fix.

Pass numparse by keyword. Adds a regression test for the '80,443' repro from the issue.

_wrap_text_to_colwidths passed the per-cell numparse flag to _type
positionally, so it filled has_invisible and numparse stayed True.
Values such as '80,443' were then cast with int() and raised
ValueError even when disable_numparse=True. Pass numparse by keyword.

Fixes astanin#428
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.

Regression of #305 in v0.10.0: disable_numparse=True is ignored when maxcolwidths is set

1 participant