Skip to content

the "update" command provides wrong $in in subtables #15726

Closed

Description

@j-xella

Describe the bug

It is my understanding that when update command works through cells, the input to the closure should be the value of the current cell. This does not seem to be the case when the table is not on the top level.

How to reproduce

With a simple table, update works as expected:

[ { y: "1" } { y: "2" } ] | update y { into float } | to yaml

produces

- y: 1.0
- y: 2.0

However, when the same table is buried deeper into the structure, it is different.

{ w: { x: [ { y: "1" } { y: "2" } ] } } | update w.x.y { into float } | to yaml

produces

w:
  x:
  - y:
    - 1.0
    - 2.0
  - y:
    - 1.0
    - 2.0

It seems like the list of all column values is passed to the update closure.

Expected behavior

I expect nu to produce a structure similar to input, but with values converted to numbers:

w:
  x:
  - y:
    - 1.0
  - y:
    - 2.0

Configuration

key value
version 0.104.0
major 0
minor 104
patch 0
branch
commit_hash cda15d9
build_os linux-x86_64
build_target x86_64-unknown-linux-musl
rust_version rustc 1.84.1 (e71f9a9a9 2025-01-27)
rust_channel 1.84.1-x86_64-unknown-linux-gnu
cargo_version cargo 1.84.1 (66221abde 2024-11-19)
build_time 2025-04-29 23:57:06 +00:00
build_rust_channel release
allocator standard
features default, sqlite, static-link-openssl, trash
installed_plugins polars 0.104.0, query 0.104.0

Activity

  1. added
    status:needs-triage
    on May 9, 2025
  2. added
    A:cell-path-semantics
    on May 18, 2025
  3. fdncred commented on May 14, 2026

    @fdncred
    Contributor

    I took a swing at fixing this here #18205. Please review and let me know if it fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:cell-path-semanticsstatus:needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions