mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 07:46:01 +02:00
Groupby operations on dataframes (#3473)
* Added PolarsStruct enum to implement groupby * template groupby * groupby operationi on dataframes
This commit is contained in:
@ -46,7 +46,7 @@ pub enum InlineShape {
|
||||
|
||||
// TODO: Dataframe type
|
||||
#[cfg(feature = "dataframe")]
|
||||
Dataframe,
|
||||
DataFrame,
|
||||
|
||||
// Stream markers (used as bookend markers rather than actual values)
|
||||
BeginningOfStream,
|
||||
@ -130,7 +130,7 @@ impl InlineShape {
|
||||
UntaggedValue::Error(_) => InlineShape::Error,
|
||||
UntaggedValue::Block(_) => InlineShape::Block,
|
||||
#[cfg(feature = "dataframe")]
|
||||
UntaggedValue::Dataframe(_) => InlineShape::Dataframe,
|
||||
UntaggedValue::DataFrame(_) => InlineShape::DataFrame,
|
||||
}
|
||||
}
|
||||
|
||||
@ -322,7 +322,7 @@ impl PrettyDebug for FormatInlineShape {
|
||||
InlineShape::Block => DbgDocBldr::opaque("block"),
|
||||
InlineShape::Error => DbgDocBldr::error("error"),
|
||||
#[cfg(feature = "dataframe")]
|
||||
InlineShape::Dataframe => DbgDocBldr::error("dataframe_pretty_FormatInlineShape"),
|
||||
InlineShape::DataFrame => DbgDocBldr::error("dataframe_pretty_formatter"),
|
||||
InlineShape::BeginningOfStream => DbgDocBldr::blank(),
|
||||
InlineShape::EndOfStream => DbgDocBldr::blank(),
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ fn helper(v: &Value) -> Result<toml::Value, ShellError> {
|
||||
UntaggedValue::Error(e) => return Err(e.clone()),
|
||||
UntaggedValue::Block(_) => toml::Value::String("<Block>".to_string()),
|
||||
#[cfg(feature = "dataframe")]
|
||||
UntaggedValue::Dataframe(_) => toml::Value::String("<Dataframe>".to_string()),
|
||||
UntaggedValue::DataFrame(_) => toml::Value::String("<Data>".to_string()),
|
||||
UntaggedValue::Primitive(Primitive::Range(_)) => toml::Value::String("<Range>".to_string()),
|
||||
UntaggedValue::Primitive(Primitive::Binary(b)) => {
|
||||
toml::Value::Array(b.iter().map(|x| toml::Value::Integer(*x as i64)).collect())
|
||||
|
Reference in New Issue
Block a user