Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion knack/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def _auto_table_item(self, item):
for k in keys:
if k in _TableOutput.SKIP_KEYS:
continue
if item[k] and not isinstance(item[k], (list, dict, set)):
if item[k] is not None and not isinstance(item[k], (list, dict, set)):
new_entry[_TableOutput._capitalize_first_char(k)] = item[k]
except AttributeError:
# handles odd cases where a string/bool/etc. is returned
Expand Down
7 changes: 4 additions & 3 deletions tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ def test_out_table(self):
obj = OrderedDict()
obj['active'] = True
obj['val'] = '0b1f6472'
obj['lun'] = 0
output_producer.out(CommandResultItem(obj), formatter=format_table, out_file=self.io)
self.assertEqual(normalize_newlines(self.io.getvalue()), normalize_newlines(
"""Active Val
-------- --------
True 0b1f6472
"""Active Lun Val
-------- ----- --------
True 0 0b1f6472
"""))

def test_out_table_list_of_lists(self):
Expand Down