nushell/crates/nu-cmd-dataframe/src/dataframe/values
Devyn Cairns 73f3c0b60b
Support for all custom value operations on plugin custom values (#12088)
# Description

Adds support for the following operations on plugin custom values, in
addition to `to_base_value` which was already present:

- `follow_path_int()`
- `follow_path_string()`
- `partial_cmp()`
- `operation()`
- `Drop` (notification, if opted into with
`CustomValue::notify_plugin_on_drop`)

There are additionally customizable methods within the `Plugin` and
`StreamingPlugin` traits for implementing these functions in a way that
requires access to the plugin state, as a registered handle model such
as might be used in a dataframes plugin would.

`Value::append` was also changed to handle custom values correctly.

# User-Facing Changes

- Signature of `CustomValue::follow_path_string` and
`CustomValue::follow_path_int` changed to give access to the span of the
custom value itself, useful for some errors.
- Plugins using custom values have to be recompiled because the engine
will try to do custom value operations that aren't supported
- Plugins can do more things 🎉 

# Tests + Formatting
Tests were added for all of the new custom values functionality.

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

# After Submitting
- [ ] Document protocol reference `CustomValueOp` variants:
  - [ ] `FollowPathInt`
  - [ ] `FollowPathString`
  - [ ] `PartialCmp`
  - [ ] `Operation`
  - [ ] `Dropped`
- [ ] Document `notify_on_drop` optional field in `PluginCustomValue`
2024-03-12 10:37:08 +01:00
..
nu_dataframe Support for all custom value operations on plugin custom values (#12088) 2024-03-12 10:37:08 +01:00
nu_expression Bump polars from 0.36 to 0.37 (#11848) 2024-02-13 06:27:30 -06:00
nu_lazyframe Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00
nu_lazygroupby Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
nu_when Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
mod.rs Ability to cast a dataframe's column to a different dtype (#11803) 2024-02-14 18:15:00 -06:00
nu_schema.rs Remove Record::from_raw_cols_vals_unchecked (#11810) 2024-02-18 14:20:22 +02:00
utils.rs Convert Shellerror::GenericError to named fields (#11230) 2023-12-07 00:40:03 +01:00