Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ComputeError( "...The column is already aggregated.") #5144

Closed
2 tasks done
AnatolyBuga opened this issue Oct 8, 2022 · 0 comments · Fixed by #5265
Closed
2 tasks done

ComputeError( "...The column is already aggregated.") #5144

AnatolyBuga opened this issue Oct 8, 2022 · 0 comments · Fixed by #5265
Labels
bug Something isn't working rust Related to Rust Polars

Comments

@AnatolyBuga
Copy link
Contributor

AnatolyBuga commented Oct 8, 2022

Polars version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of Polars.

Issue description

Hello Team Polars,

This issue might be related to 4978.

This was not the case with 0.23.x In this example I would expect ColumnNotFound Error. But instead I get this:

ComputeError(
        Owned(
            "Cannot aggregate as sum. The column is already aggregated.",
        ),
    ),

Reproducible example

pub fn issue(){

    let mut df1 = df![
        "a" => ["a", "b", "c", "a", "d"],
        "b" => [true, false, true, true, true],
        "c" => [Some(1), None, Some(3), Some(4), Some(5)]
    ].unwrap(); 

    dbg!(df1.lazy().groupby([col("a"), col("b"), col("c")])
        .agg([
            example().sum().alias("new_name")]).collect());
}

pub(crate) fn example () -> Expr {

    apply_multiple(
        move |columns| {
            let df = df! [
                "d" => &columns[0],
                "e" => &columns[1],
                "f" => &columns[2]
            ]?;
            let res = df.column("noSuchColumn")?;
            Ok(res.to_owned())
        },
        &[
            col("a") ,
            col("b"),
            col("c"),
        ],
        GetOutput::from_type(DataType::Float64),
    )
}

Expected behavior

Column Not Found Error

Installed versions

Replace this line with a list of feature gates
@AnatolyBuga AnatolyBuga added bug Something isn't working rust Related to Rust Polars labels Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rust Related to Rust Polars
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant