Skip to content

group_by(_).agg(lit(Series(_))) silently ignores values after first #22103

@coastalwhite

Description

@coastalwhite

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl
df = pl.DataFrame({
    "g": [0, 1],
})
df.group_by("g").agg(foo=pl.lit(pl.Series([42, 2, 3])))

Log output

shape: (2, 2)
+-----+-----+
| g   | foo |
| --- | --- |
| i64 | i64 |
+===========+
| 1   | 42  |
|-----+-----|
| 0   | 42  |
+-----+-----+

Issue description

Values 2 and 3 are silently ignored.

Expected behavior

An error probably.

Installed versions

Replace this line with the output of pl.show_versions(). Leave the backticks in place.

Metadata

Metadata

Assignees

Labels

P-highPriority: highacceptedReady for implementationbugSomething isn't workingpythonRelated to Python Polars

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions