mirror of
https://github.com/nushell/nushell.git
synced 2025-05-30 14:50:02 +02:00
Only mark collected dataframes as from_lazy=false when collect is called from the collect command. (#12571)
I had previously changed NuLazyFrame::collect to set the NuDataFrame's from_lazy field to false to prevent conversion back to a lazy frame. It appears there are cases where this should happen. Instead, I am only setting from_lazy=false inside the `polars collect` command. [Related discord message](https://discord.com/channels/601130461678272522/1227612017171501136/1230600465159421993) Co-authored-by: Jack Wright <jack.wright@disqo.com>
This commit is contained in:
parent
9a265847e2
commit
cc7b5c5a26
@ -64,7 +64,9 @@ impl PluginCommand for LazyCollect {
|
|||||||
let value = input.into_value(call.head);
|
let value = input.into_value(call.head);
|
||||||
match PolarsPluginObject::try_from_value(plugin, &value)? {
|
match PolarsPluginObject::try_from_value(plugin, &value)? {
|
||||||
PolarsPluginObject::NuLazyFrame(lazy) => {
|
PolarsPluginObject::NuLazyFrame(lazy) => {
|
||||||
let eager = lazy.collect(call.head)?;
|
let mut eager = lazy.collect(call.head)?;
|
||||||
|
// We don't want this converted back to a lazy frame
|
||||||
|
eager.from_lazy = true;
|
||||||
Ok(PipelineData::Value(
|
Ok(PipelineData::Value(
|
||||||
eager
|
eager
|
||||||
.cache(plugin, engine, call.head)?
|
.cache(plugin, engine, call.head)?
|
||||||
|
@ -64,7 +64,7 @@ impl NuLazyFrame {
|
|||||||
help: None,
|
help: None,
|
||||||
inner: vec![],
|
inner: vec![],
|
||||||
})
|
})
|
||||||
.map(|df| NuDataFrame::new(false, df))
|
.map(|df| NuDataFrame::new(true, df))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn apply_with_expr<F>(self, expr: NuExpression, f: F) -> Self
|
pub fn apply_with_expr<F>(self, expr: NuExpression, f: F) -> Self
|
||||||
|
Loading…
x
Reference in New Issue
Block a user