Kotlin / Kotlin/dataframe

Improve `GroupBy` transformation method names

Open
#1,931 2 comments 0 reactions 0 assignees View on GitHub
API
Dominant language
Kotlin
Stars
1.1k
Forks
83
Avg merge
4d 12h
Merged PRs (30d)
30

Description

Now we have a bunch of `GroupBy` transformation methods, but their names are really confusing:
Image

* `sortByGroup`, `sortByCount`, `sortByKey` looks like `sortBy` shortcuts, but actually `sortBy` sorts rows inside groups while others sort the order of groups.
* `filter`/`add` filters rows / add columns to groups, but can be understood as methods that filters/adds new groups (key-group pairs) to the `GroupBy`.
* `updateGroups` - fine, its name perfectly reflects what it does! And this is the only method with the name that clearly makes it clear what it’s working with. In fact, `sortBy`, `filter` and `add` are shortcuts for `updateGroups`, but their names don't reflect that!

So, we need to rename these methods for clear understanding whether method works with key-group pairs or group rows.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the GroupBy transformation methods named in the issue: sortBy, sortByGroup, sortByCount, sortByKey, filter, add, and updateGroups. Establish a naming scheme that distinguishes operations on group rows from operations on key-group pairs, then trace the affected API usage. Done means the renamed methods consistently communicate which level they transform.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
data
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.