mirror of
https://github.com/nushell/nushell.git
synced 2024-11-28 03:13:44 +01:00
Update merge example (#13985)
# Description All credit to @AlifianK for suggesting this in the doc repo (https://github.com/nushell/nushell.github.io/pull/1571). This updates the merge example to make it more clear by using a different set of numbers that can't easily be confused with an `index`. Also changes the `index` to `id` to remove the "magic column name conversion". (#13780). # User-Facing Changes Help/Doc change only # Tests + Formatting - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib` # After Submitting N/A
This commit is contained in:
parent
702dcd8581
commit
52eb9c2ef3
@ -38,21 +38,21 @@ repeating this process with row 1, and so on."#
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![
|
||||
Example {
|
||||
example: "[a b c] | wrap name | merge ( [1 2 3] | wrap index )",
|
||||
description: "Add an 'index' column to the input table",
|
||||
example: "[a b c] | wrap name | merge ( [47 512 618] | wrap id )",
|
||||
description: "Add an 'id' column to the input table",
|
||||
result: Some(Value::list(
|
||||
vec![
|
||||
Value::test_record(record! {
|
||||
"name" => Value::test_string("a"),
|
||||
"index" => Value::test_int(1),
|
||||
"id" => Value::test_int(47),
|
||||
}),
|
||||
Value::test_record(record! {
|
||||
"name" => Value::test_string("b"),
|
||||
"index" => Value::test_int(2),
|
||||
"id" => Value::test_int(512),
|
||||
}),
|
||||
Value::test_record(record! {
|
||||
"name" => Value::test_string("c"),
|
||||
"index" => Value::test_int(3),
|
||||
"id" => Value::test_int(618),
|
||||
}),
|
||||
],
|
||||
Span::test_data(),
|
||||
|
Loading…
Reference in New Issue
Block a user