diff --git a/crates/nu-command/src/table.rs b/crates/nu-command/src/table.rs index 45109cec3f..25914f6e22 100644 --- a/crates/nu-command/src/table.rs +++ b/crates/nu-command/src/table.rs @@ -74,10 +74,14 @@ fn convert_to_table(iter: impl IntoIterator) -> Option" { + Ok(item.clone()) + } else { + item.clone().follow_cell_path(&[PathMember::String { + val: header.into(), + span: Span::unknown(), + }]) + }; match result { Ok(value) => row.push(value.into_string()), diff --git a/crates/nu-protocol/src/value/mod.rs b/crates/nu-protocol/src/value/mod.rs index bdb31de395..f27dc45bbc 100644 --- a/crates/nu-protocol/src/value/mod.rs +++ b/crates/nu-protocol/src/value/mod.rs @@ -290,7 +290,7 @@ impl Value { pub fn columns(&self) -> Vec { match self { Value::Record { cols, .. } => cols.clone(), - _ => vec![], + _ => vec!["".into()], } } }