Skip to content

Conversation

@tomjemmett
Copy link

PR Description

This PR resolves #1534 by switching from register_groupby_method to register_dataframe_groupby_method and register_series_groupby_method, as the former has been removed in pandas-flavor 0.8.1.

PR Checklist

Please ensure that you have done the following:

  1. PR in from a fork off your branch. Do not PR from <your_username>:dev, but rather from <your_username>:<feature-branch_name>.
  1. If you're not on the contributors list, add yourself to AUTHORS.md.
  1. Add a line to CHANGELOG.md under the latest version header (i.e. the one that is "on deck") describing the contribution.
    • Do use some discretion here; if there are multiple PRs that are related, keep them in a single line.

Relevant Reviewers

Copilot AI review requested due to automatic review settings November 26, 2025 11:00
@tomjemmett
Copy link
Author

I've locally tested this in my own codebase, and it seems to work. Running tests locally I got a fair few errors, but I was getting the same errors before making the changes.

Copilot finished reviewing on behalf of tomjemmett November 26, 2025 11:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates pyjanitor to be compatible with pandas-flavor 0.8.1 by replacing the deprecated register_groupby_method decorator with the new specific decorators register_dataframe_groupby_method and register_series_groupby_method.

  • Migrates from deprecated register_groupby_method to type-specific decorators
  • Updates four functions across three files (summarise, mutate, ungroup, select)
  • Adds appropriate decorators based on whether functions work with DataFrameGroupBy, SeriesGroupBy, or both

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
janitor/functions/summarise.py Replaced register_groupby_method with register_dataframe_groupby_method for the summarise function
janitor/functions/select.py Replaced register_groupby_method with both register_dataframe_groupby_method and register_series_groupby_method for the select function which supports both groupby types
janitor/functions/mutate.py Replaced register_groupby_method with register_dataframe_groupby_method for both ungroup and mutate functions
CHANGELOG.md Added entry documenting this enhancement
AUTHORS.md Added new contributor entry

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@samukweku
Copy link
Collaborator

Related: #1532

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.

pyjanitor 0.32.1 fails to import with pandas_flavor 0.8.1: AttributeError on register_groupby_method

2 participants