mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 00:44:57 +02:00
Groupby operations on dataframes (#3473)
* Added PolarsStruct enum to implement groupby * template groupby * groupby operationi on dataframes
This commit is contained in:
@ -74,7 +74,7 @@ pub enum Type {
|
||||
|
||||
/// Dataframe
|
||||
#[cfg(feature = "dataframe")]
|
||||
Dataframe,
|
||||
DataFrame,
|
||||
}
|
||||
|
||||
/// A shape representation of the type of a row
|
||||
@ -191,7 +191,7 @@ impl Type {
|
||||
UntaggedValue::Error(_) => Type::Error,
|
||||
UntaggedValue::Block(_) => Type::Block,
|
||||
#[cfg(feature = "dataframe")]
|
||||
UntaggedValue::Dataframe(_) => Type::Dataframe,
|
||||
UntaggedValue::DataFrame(_) => Type::DataFrame,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -298,7 +298,7 @@ impl PrettyDebug for Type {
|
||||
}
|
||||
Type::Block => ty("block"),
|
||||
#[cfg(feature = "dataframe")]
|
||||
Type::Dataframe => ty("dataframe_pretty_debug_for_Type"),
|
||||
Type::DataFrame => ty("data_type_formatter"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,9 +51,10 @@ pub enum UntaggedValue {
|
||||
/// A block of Nu code, eg `{ ls | get name ; echo "done" }` with its captured values
|
||||
Block(Box<hir::CapturedBlock>),
|
||||
|
||||
/// NuDataframe
|
||||
/// Data option that holds the polars structs required to to data
|
||||
/// manipulation and operations using polars dataframes
|
||||
#[cfg(feature = "dataframe")]
|
||||
Dataframe(NuDataFrame),
|
||||
DataFrame(NuDataFrame),
|
||||
}
|
||||
|
||||
impl UntaggedValue {
|
||||
@ -671,7 +672,7 @@ impl ShellTypeName for UntaggedValue {
|
||||
UntaggedValue::Error(_) => "error",
|
||||
UntaggedValue::Block(_) => "block",
|
||||
#[cfg(feature = "dataframe")]
|
||||
UntaggedValue::Dataframe(_) => "dataframe",
|
||||
UntaggedValue::DataFrame(_) => "dataframe",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ impl PrettyDebug for Value {
|
||||
UntaggedValue::Error(_) => DbgDocBldr::error("error"),
|
||||
UntaggedValue::Block(_) => DbgDocBldr::opaque("block"),
|
||||
#[cfg(feature = "dataframe")]
|
||||
UntaggedValue::Dataframe(_) => DbgDocBldr::opaque("dataframe_prettydebug_for_Value"),
|
||||
UntaggedValue::DataFrame(_) => DbgDocBldr::opaque("dataframe_prettydebug_for_data"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user