Skip to content

allow int as a cellpath for select - #10048

Merged
fdncred merged 3 commits into
nushell:mainfrom
fdncred:allow_ints_as_select_cellpaths
Aug 18, 2023
Merged

fdncred merged 3 commits into
nushell:mainfrom
fdncred:allow_ints_as_select_cellpaths

Conversation

@fdncred

@fdncred fdncred commented Aug 18, 2023

Copy link
Copy Markdown
Contributor

Description

This PR allows ints to be used as cell paths.

Before

❯ let index = 0
❯ locations | select $index
Error: nu::shell::cant_convert

  × Can't convert to cell path.
   ╭─[entry #26:1:1]
 1 │ locations | select $index
   ·                    ───┬──
   ·                       ╰── can't convert int to cell path
   ╰────

After

❯ let index = 0
❯ locations | select $index
╭#┬───────location────────┬city_column┬state_column┬country_column┬lat_column┬lon_column╮
│0│http://ip-api.com/json/│city       │region      │countryCode   │lat       │lon       │
╰─┴───────────────────────┴───────────┴────────────┴──────────────┴──────────┴──────────╯

User-Facing Changes

Tests + Formatting

After Submitting

@fdncred
fdncred merged commit fe71222 into nushell:main Aug 18, 2023
@fdncred
fdncred deleted the allow_ints_as_select_cellpaths branch August 18, 2023 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant