mars-project / mars-project/mars
Using aggregation instead of transform to perform `df.groupby().nunique()`
Open
Nobody has claimed this yet.
mod: dataframe
task: medium
type: enhancement
- Dominant language
- Python
- Stars
- 2.7k
- Forks
- 325
- PR merge metrics
- No merged PRs in 30d
Description
Now, df.groupby().nunique() would be delegated to transform to perform execution, it will be a shuffle operation which is very time consuming, we can delegate it to aggregation which is way more optimized.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the df.groupby().nunique() entry point and comparing its current transform execution path with the existing aggregation path. Confirm that the change avoids the expensive shuffle while preserving groupby().nunique() results, then add or update coverage for this operation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python
- Domain
- data
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100