mars-project / mars-project/mars

Using aggregation instead of transform to perform `df.groupby().nunique()`

Open
#2,966 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.