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

GroupBy not extensible #871

Open
Jolanrensen opened this issue Sep 18, 2024 · 0 comments · May be fixed by #872
Open

GroupBy not extensible #871

Jolanrensen opened this issue Sep 18, 2024 · 0 comments · May be fixed by #872
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Jolanrensen
Copy link
Collaborator

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

@Jolanrensen Jolanrensen added the enhancement New feature or request label Sep 18, 2024
@Jolanrensen Jolanrensen self-assigned this Sep 18, 2024
@Jolanrensen Jolanrensen linked a pull request Sep 18, 2024 that will close this issue
@Jolanrensen Jolanrensen added this to the 0.14.0 milestone Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant