Skip to content

format + where fails on a DataFrame with a ColumnGroup #1888

@Allex-Nik

Description

@Allex-Nik

When format with a where clause is applied to a DataFrame containing a ColumnGroup, if fails with an exception saying that the column mentioned in the where clause is not found.
The problem does not occur if the where clause is removed or if the ColumnGroup is ungrouped.

Here is an example:

val df = dataFrameOf("firstName", "lastName", "age")(
    "Alice", "Cooper", 15,
    "Bob", "Dylan", 45,
    "Charlie", "Daniels", 20,
)

val groupedName = df.group { firstName and lastName }.into("name")

// this works
df.format { all() }.where { age < 18 }.with { background(RgbColor(242, 210, 189)) and textColor(black) }

// this also works
groupedName.format { all() }.with { background(RgbColor(242, 210, 189)) and textColor(black) }

// this fails
groupedName.format { all() }.where { age < 18 }.with { background(RgbColor(242, 210, 189)) and textColor(black) }

The exception from the example is the following: java.lang.IllegalArgumentException: Column not found: 'age'.

A notebook with the example is attached below.

formatIssue.ipynb

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions