Skip to content

Cell paths drill into nested tables #7494

Closed

Description

@rgwood

Describe the bug

image

Cell paths are able to drill into nested tables in an unexpected way.

How to reproduce

  1. Create a table nested in a list: [ [{ foo: "bar" }] ]
  2. Use a cell path for a column in the nested table: [ [{ foo: "bar" }] ] | get foo or [ [{ foo: "bar" }] ].foo
  3. Observe that you get a result instead of an error

Expected behavior

I expected Nu to return a ShellError, or maybe Nothing. IMO drilling into columns of nested tables automatically is very unexpected behaviour.

Screenshots

No response

Configuration

key value
version 0.72.2
branch main
commit_hash 5b5f1d1
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.65.0 (897e37553 2022-11-02)
rust_channel 1.65.0-x86_64-unknown-linux-gnu
cargo_version cargo 1.65.0 (4bc8f24d3 2022-10-20)
pkg_version 0.72.2
build_time 2022-12-12 14:57:49 -08:00
build_rust_channel release
features database, default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. stormasm commented on Dec 16, 2022

    @stormasm
    Contributor
    [ [{ foo: "bar" }] ] | get 0 | to nuon
    
    [[foo]; [bar]]
     
    [ [{ foo: "bar" }] ] | get 0.foo | to nuon
    
    [bar]

    However this is the correct behavior and is currently working fine...

  2. added a commit that references this issue on Dec 16, 2022
    2d07c6e
  3. added this to the v0.73 milestone on Dec 16, 2022
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions