In your current logic, if a user specifies `show_units=False` and there are units, then it will change to `show_units = True`.  That isn't the desired behavior because it overrides what the user specified.  So you need to do:
```
if show_unit is None:
    show_unit = any([col.unit ... ])
```