Two consecutive calls to into-lazy should not fail (#12505)

# Description

From @maxim-uvarov's
[post](https://discord.com/channels/601130461678272522/1227612017171501136/1228656319704203375).

When calling `to-lazy` back to back in a pipeline, an error should not
occur:

```
> [[a b]; [6 2] [1 4] [4 1]] | polars into-lazy | polars into-lazy
Error: nu:🐚:cant_convert

  × Can't convert to NuDataFrame.
   ╭─[entry #1:1:30]
 1 │ [[a b]; [6 2] [1 4] [4 1]] | polars into-lazy | polars into-lazy
   ·                              ────────┬───────
   ·                                      ╰── can't convert NuLazyFrameCustomValue to NuDataFrame
   ╰────
 ```

This pull request ensures that custom value's of NuLazyFrameCustomValue are properly converted when passed in.

Co-authored-by: Jack Wright <jack.wright@disqo.com>
This commit is contained in:
Jack Wright 2024-04-13 11:00:46 -07:00 committed by GitHub
parent b9dd47ebb7
commit 10a9a17b8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -162,7 +162,9 @@ impl NuDataFrame {
for value in iter {
match value {
Value::Custom { .. } => return Self::try_from_value(plugin, &value),
Value::Custom { .. } => {
return Self::try_from_value_coerce(plugin, &value, value.span());
}
Value::List { vals, .. } => {
let record = vals
.into_iter()