mirror of
https://github.com/nushell/nushell.git
synced 2025-05-29 06:17:54 +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("to-supertypes", "Cast to supertypes", None)
|
||||
.switch("diagonal", "Concatenate dataframes diagonally", None)
|
||||
.switch(
|
||||
"no-maintain-order",
|
||||
"Do not maintain order. The default behavior is to maintain order.",
|
||||
None,
|
||||
)
|
||||
.switch(
|
||||
"from-partitioned-ds",
|
||||
"Concatenate dataframes from a partitioned dataset",
|
||||
@ -109,6 +114,7 @@ fn command_lazy(
|
||||
let to_supertypes = call.has_flag("to-supertypes")?;
|
||||
let diagonal = call.has_flag("diagonal")?;
|
||||
let from_partitioned_ds = call.has_flag("from-partitioned-ds")?;
|
||||
let maintain_order = !call.has_flag("no-maintain-order")?;
|
||||
let mut dataframes = call
|
||||
.rest::<Value>(0)?
|
||||
.iter()
|
||||
@ -133,8 +139,7 @@ fn command_lazy(
|
||||
to_supertypes,
|
||||
diagonal,
|
||||
from_partitioned_ds,
|
||||
// todo - expose maintain order
|
||||
..Default::default()
|
||||
maintain_order,
|
||||
};
|
||||
|
||||
let res: NuLazyFrame = polars::prelude::concat(&dataframes, args)
|
||||
|
Loading…
x
Reference in New Issue
Block a user