Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow int as a cellpath for select #10048

Merged
merged 3 commits into from Aug 18, 2023

Conversation

fdncred
Copy link
Collaborator

@fdncred fdncred commented Aug 18, 2023

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
19 checks passed
@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.

None yet

1 participant