mirror of
https://github.com/nushell/nushell.git
synced 2025-05-30 22:57:07 +02:00
Expose flag to not maintain order on polars concat
(#15145)
This commit is contained in:
parent
c504c93a1d
commit
3d58c3f70e
@ -34,6 +34,11 @@ impl PluginCommand for ConcatDF {
|
|||||||
.switch("rechunk", "Rechunk the resulting dataframe", None)
|
.switch("rechunk", "Rechunk the resulting dataframe", None)
|
||||||
.switch("to-supertypes", "Cast to supertypes", None)
|
.switch("to-supertypes", "Cast to supertypes", None)
|
||||||
.switch("diagonal", "Concatenate dataframes diagonally", None)
|
.switch("diagonal", "Concatenate dataframes diagonally", None)
|
||||||
|
.switch(
|
||||||
|
"no-maintain-order",
|
||||||
|
"Do not maintain order. The default behavior is to maintain order.",
|
||||||
|
None,
|
||||||
|
)
|
||||||
.switch(
|
.switch(
|
||||||
"from-partitioned-ds",
|
"from-partitioned-ds",
|
||||||
"Concatenate dataframes from a partitioned dataset",
|
"Concatenate dataframes from a partitioned dataset",
|
||||||
@ -109,6 +114,7 @@ fn command_lazy(
|
|||||||
let to_supertypes = call.has_flag("to-supertypes")?;
|
let to_supertypes = call.has_flag("to-supertypes")?;
|
||||||
let diagonal = call.has_flag("diagonal")?;
|
let diagonal = call.has_flag("diagonal")?;
|
||||||
let from_partitioned_ds = call.has_flag("from-partitioned-ds")?;
|
let from_partitioned_ds = call.has_flag("from-partitioned-ds")?;
|
||||||
|
let maintain_order = !call.has_flag("no-maintain-order")?;
|
||||||
let mut dataframes = call
|
let mut dataframes = call
|
||||||
.rest::<Value>(0)?
|
.rest::<Value>(0)?
|
||||||
.iter()
|
.iter()
|
||||||
@ -133,8 +139,7 @@ fn command_lazy(
|
|||||||
to_supertypes,
|
to_supertypes,
|
||||||
diagonal,
|
diagonal,
|
||||||
from_partitioned_ds,
|
from_partitioned_ds,
|
||||||
// todo - expose maintain order
|
maintain_order,
|
||||||
..Default::default()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let res: NuLazyFrame = polars::prelude::concat(&dataframes, args)
|
let res: NuLazyFrame = polars::prelude::concat(&dataframes, args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user