Skip to content

BUG: Not properly checking if post_processing function is callable or not in _get_cythonized_result() function in class GroupBy #33955

Closed
@KenilMehta

Description

@KenilMehta
  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.

Problem description

While looking at the code, I found this line which I think is a bug. In the current master branch, pandas/core/groupby/groupby.py file, in the _get_cythonized_result() function :

        if post_processing:
            if not callable(pre_processing):
                raise ValueError("'post_processing' must be a callable!")

While checking if post_processing is callable or not, we are actually passing pre_processing object instead of post_processing. This looks like a bug.

Expected Code

        if post_processing:
            if not callable(post_processing):
                raise ValueError("'post_processing' must be a callable!")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions