Repository navigation
Honor disable_numparse while wrapping column widths - #471
ShamikOfficial wants to merge 1 commit into
Conversation
The flag was bound to has_invisible, so disable_numparse was ignored for values like 100,120. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The keyword argument fixes the from tabulate import tabulate
tabulate([["100,120"]], tablefmt="grid") # succeeds
tabulate([["100,120"]], tablefmt="grid", maxcolwidths=20)
# ValueError: invalid literal for int() with base 10: '100,120'Adding Related: #449 already includes a fallback for the conversion failure and tests both settings. If this PR is intentionally limited to honoring Prepared with Codex assistance; the checks above were executed locally against this PR's head. |
|
Here's a small optional test-only commit, directly on your current head. It uses Two guards worth keeping: exercise selective disabling rather than only the global flag, and check the numeric neighbor so a blanket-disable workaround can't pass unnoticed. On Python 3.14.4, the test passes your pinned source; the base raises the integer-conversion error. The unchanged selective-parsing and wrapping controls pass on both. Configured Ruff checks pass. I haven't run full tox/doctests, pinned hooks, builds, CLI or the version/OS/wide-character matrix. This doesn't address the separate default-options caveat already noted above. To run just the added file: |
Fixes #448
While wrapping cells,
_type(cell, numparse)passednumparseintohas_invisible.disable_numparsewas therefore ignored, and a value such as100,120was parsed as a number.The flag is now passed as
numparse=numparse.Tested with the new regression test and the existing
disable_numparsetests.