python-tabulate icon indicating copy to clipboard operation
python-tabulate copied to clipboard

Fix column wrapping breaking with None values (fixes #312)

Open gschizas opened this issue 1 year ago • 4 comments

When using wrapping (i.e. with maxcolwidths) with a column that contains None values, the process crashes with the error TypeError: NoneType takes no arguments.

To solve that, an extra guard case is added, to return None as an empty string instead.

Includes a test.

Fixes #312

gschizas avatar Feb 27 '24 11:02 gschizas

It should probably use missingval value for consistency not an empty string.

astanin avatar Sep 26 '24 15:09 astanin

It should probably use missingval value for consistency not an empty string.

I've updated the pull request

gschizas avatar Oct 22 '24 20:10 gschizas

@astanin any chance of this PR getting merged anytime soon? thanks!

neerajmorar avatar Jan 16 '25 16:01 neerajmorar

@astanin would love to see this merged!

humzahkiani avatar Mar 08 '25 22:03 humzahkiani

This problem nags me regularly. Could you give this pull request a new try? What is needed to get it merged?

Edit: Ok, I've just seen https://github.com/astanin/python-tabulate/issues/335, so it will maybe get into a new fork.

cooper2k4 avatar Oct 15 '25 07:10 cooper2k4