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:
Douglas 2024-10-02 02:09:57 -04:00 committed by GitHub
parent 702dcd8581
commit 52eb9c2ef3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(),