Change get to remove blanks (#1534)

Remove blank values when getting a column of values
This commit is contained in:
Jonathan Turner 2020-03-30 15:36:21 +13:00 committed by GitHub
parent 906d0b920f
commit 6e71c1008d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,8 +4,8 @@ use indexmap::set::IndexSet;
use log::trace; use log::trace;
use nu_errors::ShellError; use nu_errors::ShellError;
use nu_protocol::{ use nu_protocol::{
did_you_mean, ColumnPath, PathMember, ReturnSuccess, ReturnValue, Signature, SyntaxShape, did_you_mean, ColumnPath, PathMember, Primitive, ReturnSuccess, ReturnValue, Signature,
UnspannedPathMember, UntaggedValue, Value, SyntaxShape, UnspannedPathMember, UntaggedValue, Value,
}; };
use nu_source::span_for_spanned_list; use nu_source::span_for_spanned_list;
use nu_value_ext::get_data_by_column_path; use nu_value_ext::get_data_by_column_path;
@ -221,6 +221,10 @@ pub fn get(
result.push_back(ReturnSuccess::value(item.clone())); result.push_back(ReturnSuccess::value(item.clone()));
} }
} }
Value {
value: UntaggedValue::Primitive(Primitive::Nothing),
..
} => {}
other => result.push_back(ReturnSuccess::value(other.clone())), other => result.push_back(ReturnSuccess::value(other.clone())),
}, },
Err(reason) => result.push_back(ReturnSuccess::value( Err(reason) => result.push_back(ReturnSuccess::value(