Skip to content

Cell paths drill into nested tables #7494

@rgwood

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

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