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

feat: add GroupBy.__iter__ #1394

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

feat: add GroupBy.__iter__ #1394

wants to merge 4 commits into from

Conversation

tswast
Copy link
Collaborator

@tswast tswast commented Feb 13, 2025

Note: this is a work in progress. We have two choices for the interface, and I find myself flip flopping between the two:

  1. Return an iterable of pandas objects, similar to to_pandas_batches(). To make sure we end up with all the rows together, this would mean (a) create a struct of all non-grouped fields and (b) array_agg those structs and (c) unpack those arrays and structs into DataFrame objects locally.
  2. Return an iterable of bigframes objects, each filtered to match rows belonging to the corresponding group. This would involve running a query and iterating through the results to get all the key values and then for each key value, return a DataFrame (or Series) with the corresponding filter attached.

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 internal bug 383638782 🦕

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Feb 13, 2025
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Feb 14, 2025
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.

1 participant