Skip to content

GroupBy not extensible #871

@Jolanrensen

Description

@Jolanrensen

Kandy requires their own implementation of the GroupBy interface, however, thanks to:

public fun <T, G> GroupBy<T, G>.toDataFrame(groupedColumnName: String? = null): DataFrame<T> =
    if (groupedColumnName == null || groupedColumnName == groups.name()) {
        internal().df
    } else {
        internal().df.rename(groups).into(groupedColumnName)
    }

internal fun <T, G> GroupBy<T, G>.internal(): GroupByImpl<T, G> = this as GroupByImpl<T, G>

which assumes every GroupBy is GroupByImpl, this does not work.

As far as I can see, internal() is only used to retrieve the underlying df, so it should be easy enough to open this up

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions