Infer types from regular delimited plain text unstructured files. (#1494)

* Infer types from regular delimited plain text unstructured files.

* Nothing resolves to an empty string.
This commit is contained in:
Andrés N. Robalino
2020-03-16 15:50:45 -05:00
committed by GitHub
parent d8c4565413
commit b36d21e76f
20 changed files with 751 additions and 315 deletions

View File

@ -78,16 +78,17 @@ fn converts_to_int() {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
r#"
open caco3_plastics.csv
| first 1
| str tariff_item --to-int
| where tariff_item == 2509000000
| get tariff_item
echo '{number_as_string: "1"}'
| from-json
| str number_as_string --to-int
| rename number
| where number == 1
| get number
| echo $it
"#
));
assert_eq!(actual, "2509000000");
assert_eq!(actual, "1");
}
#[test]