Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Fix groupby().any() behavior for timedelta columns with all null valuesfix issue #59712 #59750

Closed
wants to merge 3 commits into from

Conversation

40gilad
Copy link

@40gilad 40gilad commented Sep 8, 2024

This pull request addresses a bug in the groupby().any() method when applied to DataFrames with timedelta columns where all values are null (NaT). Previously, the method incorrectly returned True for groups with all null values in the timedelta column.

Changes Made:

  • Updated the _call_cython_op method to correctly handle timedelta columns when computing the any() aggregation.
  • Added a new test case to verify that groupby().any() returns False for groups where all timedelta values are null.

Issue Reference:

  • See issue #59712 for more details about the bug report.

This fix ensures that the groupby().any() method behaves consistently for timedelta columns, aligning with the behavior observed for other data types.

@rhshadrach
Copy link
Member

Thanks for the PR!

  • Added a new test case to verify that groupby().any() returns False for groups where all timedelta values are null.

Not seeing a new test. Perhaps you didn't commit it?

@rhshadrach rhshadrach added Bug Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Sep 8, 2024
@40gilad
Copy link
Author

40gilad commented Sep 8, 2024

Thanks for the PR!

  • Added a new test case to verify that groupby().any() returns False for groups where all timedelta values are null.

Not seeing a new test. Perhaps you didn't commit it?

Yeah. sorry. i did now

@rhshadrach
Copy link
Member

@40gilad - in case you didn't notice, tests on the CI are failing. Let me know if you could use an assistance.

@KevsterAmp
Copy link
Contributor

@rhshadrach - can I take over this issue? seems like this PR has gone stale

@rhshadrach
Copy link
Member

Agreed at @KevsterAmp - but there was already another open PR on this (#59782). I'd suggest giving that PR a few weeks, and if it goes stale, you're next up. Sound reasonable?

@KevsterAmp
Copy link
Contributor

Sounds good to me. Thanks

Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Oct 28, 2024
@rhshadrach
Copy link
Member

The other PR was merged. Closing.

@rhshadrach rhshadrach closed this Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Groupby Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants