fix select tests (#5577)

This commit is contained in:
WindSoilder 2022-05-18 19:20:26 +08:00 committed by GitHub
parent bb079608dd
commit 7d9a77f179
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 7 deletions

View file

@ -126,7 +126,7 @@ fn select(
//FIXME: improve implementation to not clone
let fetcher = input_val.clone().follow_cell_path(&path.members)?;
cols.push(path.into_string());
cols.push(path.into_string().replace('.', "_"));
vals.push(fetcher);
}
@ -150,11 +150,11 @@ fn select(
//FIXME: improve implementation to not clone
match x.clone().follow_cell_path(&path.members) {
Ok(value) => {
cols.push(path.into_string());
cols.push(path.into_string().replace('.', "_"));
vals.push(value);
}
Err(_) => {
cols.push(path.into_string());
cols.push(path.into_string().replace('.', "_"));
vals.push(Value::Nothing { span });
}
}
@ -175,7 +175,7 @@ fn select(
// FIXME: remove clone
let result = v.clone().follow_cell_path(&cell_path.members)?;
cols.push(cell_path.into_string());
cols.push(cell_path.into_string().replace('.', "_"));
vals.push(result);
}

View file

@ -22,8 +22,6 @@ fn regular_columns() {
assert_eq!(actual.out, "Robalino");
}
// FIXME: jt: needs more work
#[ignore]
#[test]
fn complex_nested_columns() {
Playground::setup("select_test_2", |dirs, sandbox| {
@ -57,8 +55,9 @@ fn complex_nested_columns() {
r#"
open los_tres_caballeros.json
| select nu."0xATYKARNU" nu.committers.name nu.releases.version
| where nu_releases_version > "0.8"
| get nu_releases_version
| where $it > "0.8"
| get 0
"#
));