Skip to content

feat: Add Series.combine #680

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 1 commit into from
May 11, 2024
Merged

feat: Add Series.combine #680

merged 1 commit into from
May 11, 2024

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 May 10, 2024 20:07
@TrevorBergeron TrevorBergeron requested a review from shobsi May 10, 2024 20:07
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels May 10, 2024
Copy link
Contributor

@chelsea-lin chelsea-lin left a comment

Choose a reason for hiding this comment

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

LTGM

Now, to combine the two datasets and view the highest speeds
of the birds across the two datasets

>>> s1.combine(s2, np.maximum)
Copy link
Contributor

Choose a reason for hiding this comment

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

The order of the outputs are different as pandas. How we decide the ordering of the output?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pandas will check the index of both sides, if they are not exactly the same, it will sort the index. If we wanted to copy this behavior, we would need to download the index from both sides of the operation, which I don't think is worth it. Users can always call sort_index() after combining if needed.

other (Series or scalar):
The value(s) to be combined with the `Series`.
func (function):
BigFrames DataFrames ``remote_function`` to apply.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the np.maxinum a remote function in the example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its a numpy ufunc. Having remote functions in the doctests has been problematic so far.

@TrevorBergeron TrevorBergeron merged commit 2fd1b81 into main May 11, 2024
21 checks passed
@TrevorBergeron TrevorBergeron deleted the series_combine branch May 11, 2024 01:22
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.

3 participants