nushell/crates/nu-cmd-dataframe/src/dataframe
Christopher Durham 0f600bc3f5
Improve case insensitivity consistency (#10884)
# Description

Add an extension trait `IgnoreCaseExt` to nu_utils which adds some case
insensitivity helpers, and use them throughout nu to improve the
handling of case insensitivity. Proper case folding is done via unicase,
which is already a dependency via mime_guess from nu-command.

In actuality a lot of code still does `to_lowercase`, because unicase
only provides immediate comparison and doesn't expose a `to_folded_case`
yet. And since we do a lot of `contains`/`starts_with`/`ends_with`, it's
not sufficient to just have `eq_ignore_case`. But if we get access in
the future, this makes us ready to use it with a change in one place.

Plus, it's clearer what the purpose is at the call site to call
`to_folded_case` instead of `to_lowercase` if it's exclusively for the
purpose of case insensitive comparison, even if it just does
`to_lowercase` still.

# User-Facing Changes

- Some commands that were supposed to be case insensitive remained only
insensitive to ASCII case (a-z), and now are case insensitive w.r.t.
non-ASCII characters as well.

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

---------

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
2023-11-08 23:58:54 +01:00
..
eager Improve case insensitivity consistency (#10884) 2023-11-08 23:58:54 +01:00
expressions Convert ShellError::UnsupportedInput to named fields (#10971) 2023-11-07 23:25:32 +01:00
lazy Update polars to 0.33 (#10672) 2023-10-11 21:28:18 +02:00
series Convert ShellError::UnsupportedInput to named fields (#10971) 2023-11-07 23:25:32 +01:00
values Convert ShellError::UnsupportedInput to named fields (#10971) 2023-11-07 23:25:32 +01:00
mod.rs Add a stub dfr command (#10683) 2023-10-11 17:51:20 +02:00
README.md move dataframe commands to nu-cmd-dataframe (#9241) 2023-05-19 10:56:08 -07:00
stub.rs Add a stub dfr command (#10683) 2023-10-11 17:51:20 +02:00
test_dataframe.rs Fix a couple clippy warnings (#9936) 2023-08-07 06:23:11 +12:00
utils.rs Make FromValue take owned Values (#10900) 2023-10-31 19:47:00 +01:00

Dataframe

This dataframe directory holds all of the definitions of the dataframe data structures and commands.

There are three sections of commands:

For more details see the Nushell book section on dataframes