Skip to content

fix: empty cell in select#7639

Merged
kubouch merged 1 commit intonushell:mainfrom
Decodetalkers:select_empty
Dec 31, 2022
Merged

fix: empty cell in select#7639
kubouch merged 1 commit intonushell:mainfrom
Decodetalkers:select_empty

Conversation

@Decodetalkers
Copy link
Copy Markdown
Contributor

Log: fix empty cell in select command

Description

before
image

after
image

User-Facing Changes

after this pull request #6896, select command cannot select a row which contains empty cell

Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

  • cargo fmt --all -- --check to check standard code formatting (cargo fmt --all applies these changes)
  • cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo test --workspace to check that all tests pass

After Submitting

If your PR had any user-facing changes, update the documentation after the PR is merged, if necessary. This will help us keep the docs up to date.

@Decodetalkers Decodetalkers marked this pull request as draft December 31, 2022 06:30
@Decodetalkers Decodetalkers marked this pull request as ready for review December 31, 2022 06:33
@Decodetalkers Decodetalkers force-pushed the select_empty branch 5 times, most recently from 9deed1b to 1eb6ab1 Compare December 31, 2022 07:10
@kubouch
Copy link
Copy Markdown
Contributor

kubouch commented Dec 31, 2022

Looks good to me, it makes it behave the same as get -i

Log: fix empty cell in select command
@kubouch
Copy link
Copy Markdown
Contributor

kubouch commented Dec 31, 2022

OK, thanks!

@kubouch kubouch merged commit 9382dd6 into nushell:main Dec 31, 2022
@Decodetalkers Decodetalkers deleted the select_empty branch December 31, 2022 11:19
rgwood added a commit that referenced this pull request Mar 28, 2023
This PR fixes `select` when given an empty list; it used to return
`null` when given an empty list. I also cleaned up other `select` tests
while I was in the area.

### Before:

```
> [] | select a | to nuon
null
```

### After:

```
> [] | select a | to nuon
[]
```

It looks like the previous behaviour was accidentally introduced by
[this PR](#7639).
WindSoilder pushed a commit to WindSoilder/nushell that referenced this pull request Mar 29, 2023
This PR fixes `select` when given an empty list; it used to return
`null` when given an empty list. I also cleaned up other `select` tests
while I was in the area.

### Before:

```
> [] | select a | to nuon
null
```

### After:

```
> [] | select a | to nuon
[]
```

It looks like the previous behaviour was accidentally introduced by
[this PR](nushell#7639).
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.

2 participants