Skip to content

Commit

Permalink
Move binop methods from Frame to IndexedFrame and standardize the doc…
Browse files Browse the repository at this point in the history
…string (#10576)

This PR moves all the binary operation methods such as `Frame.add` into `IndexedFrame`. This removes these methods from `Index` objects to match pandas, where Index objects do not have these methods. I have also consolidated the docstrings for these methods using a single template and our `docutils`.

Note that this is technically a breaking change that I am implementing without a deprecation cycle; however, I feel comfortable doing so because these methods were introduced incidentally in #9357 and #9542 into 21.12, so just a couple of releases ago, and since they are not pandas APIs I doubt that they have made significant penetration into user workflows.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #10576
  • Loading branch information
vyasr authored Apr 6, 2022
1 parent 261879f commit fb03c8b
Show file tree
Hide file tree
Showing 4 changed files with 892 additions and 1,620 deletions.
2 changes: 1 addition & 1 deletion python/cudf/cudf/core/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -6126,7 +6126,7 @@ def make_binop_func(op, postprocess=None):
# def postprocess(left, right, output)
# where left and right are the inputs to the binop and output is the result
# of calling the wrapped Frame binop.
wrapped_func = getattr(Frame, op)
wrapped_func = getattr(IndexedFrame, op)

@functools.wraps(wrapped_func)
def wrapper(self, other, axis="columns", level=None, fill_value=None):
Expand Down
Loading

0 comments on commit fb03c8b

Please sign in to comment.