Groupby operations on dataframes (#3473)

* Added PolarsStruct enum to implement groupby

* template groupby

* groupby operationi on dataframes
This commit is contained in:
Fernando Herrera
2021-05-23 08:37:04 +01:00
committed by GitHub
parent 5ab4199d71
commit e335e4fddc
23 changed files with 335 additions and 96 deletions

View File

@ -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(),
}

View File

@ -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())