Skip to content

Fix complete groupby - #1700

Open
SumanGouda wants to merge 7 commits into
pyjanitor-devs:devfrom
SumanGouda:fix-complete-groupby
Open

Fix complete groupby#1700
SumanGouda wants to merge 7 commits into
pyjanitor-devs:devfrom
SumanGouda:fix-complete-groupby

Conversation

@SumanGouda

Copy link
Copy Markdown

PR Description

  • Uses getattr(df, "obj", df).columns in _computations_complete to safely inspect column names without raising AttributeError when df is a DataFrameGroupBy object.
  • Adds early validation to check if keys passed in fill_value exist in the target DataFrame.
  • Filters missing column keys (col in fill_value) during dictionary construction to prevent KeyError crashes when passing partial fill_value dictionaries.
  • Preserves grouping context by delaying df = df.obj unpacking until after df.expand() executes.

This PR resolves #1669.

PR Checklist

Please ensure that you have done the following:

  1. PR in from a fork off your branch.
  2. Add a line to CHANGELOG.md under the latest version header describing the contribution.

Relevant Reviewers

Please tag maintainers to review.

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.99%. Comparing base (901f4b3) to head (ee4007d).
⚠️ Report is 218 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1700      +/-   ##
==========================================
- Coverage   87.56%   85.99%   -1.58%     
==========================================
  Files          95      125      +30     
  Lines        6819     9965    +3146     
==========================================
+ Hits         5971     8569    +2598     
- Misses        848     1396     +548     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samukweku samukweku left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adorn.py should not be in this pr, same goes for the GitHub template.md file

@samukweku samukweku left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly rebase your pr and keep out unrelated code/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PERF] Speed up complete for unsorted domains and many groups

2 participants