Skip to content

group-by should accept ? for optional path members #9003

Closed

Description

@rgwood

group-by fails if the specified column is not present on any rows:

> [{'a': 1}, {'a': 2} {}] | group-by a
Error: nu::shell::column_not_found

  × Cannot find column
   ╭─[entry #6:1:1]
 1 │ [{'a': 1}, {'a': 2} {}] | group-by a
   ·                     ─┬    ────┬───
   ·                      │        ╰── cannot find column 'a'
   ·                      ╰── value originates here
   ╰────

Would be nice if group-by worked with ? so you could do group-by a? and it would ignore any rows without an a column.

Context: this came up as a usability issue on Discord https://discord.com/channels/601130461678272522/614593951969574961/1100648770326233199

Activity

  1. added
    good first issue
    and removed
    good first issue
    on Apr 26, 2023
  2. added
    category:inconsistent-behavior
    semantics
    on Apr 26, 2023
  3. added a commit that references this issue on May 17, 2023
    9ce61dc
  4. added this to the v0.81.0 milestone on May 19, 2023
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

    category:inconsistent-behaviorsemantics

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions