Skip to content

feat: Add first, last support to GroupBy #1969

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

Merged
merged 5 commits into from
Aug 7, 2025
Merged

feat: Add first, last support to GroupBy #1969

merged 5 commits into from
Aug 7, 2025

Conversation

TrevorBergeron
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@TrevorBergeron TrevorBergeron requested review from a team as code owners August 6, 2025 01:19
@TrevorBergeron TrevorBergeron requested a review from sycai August 6, 2025 01:19
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Aug 6, 2025
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. label Aug 6, 2025
@TrevorBergeron TrevorBergeron linked an issue Aug 6, 2025 that may be closed by this pull request
@shuoweil
Copy link
Contributor

shuoweil commented Aug 6, 2025

@TrevorBergeron Please check presubmit, it looks like we have a failed test for groupby. Thanks a lot.

sycai
sycai previously approved these changes Aug 6, 2025
grouping_keys=tuple(self._by_col_ids),
min_periods=min_count if min_count >= 0 else 0,
)
to_use, index = self._aggregated_columns(numeric_only)
Copy link
Contributor

Choose a reason for hiding this comment

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

naming nit: "to_use" -> "target_cols"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

grouping_keys=tuple(self._by_col_ids),
min_periods=min_count if min_count >= 0 else 0,
)
to_use, index = self._aggregated_columns(numeric_only)
Copy link
Contributor

Choose a reason for hiding this comment

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

naming nit: "to_use" -> "target_cols"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@TrevorBergeron TrevorBergeron merged commit 41dda88 into main Aug 7, 2025
18 of 25 checks passed
@TrevorBergeron TrevorBergeron deleted the group_first branch August 7, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support "first" aggregation function
4 participants