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

Don't proxy non-bound class functions in cudf.pandas #15646

Conversation

mroeschke
Copy link
Contributor

Description

closes #15637

If a user has code like

    class Foo:
        @pd.util._decorators.deprecate_kwarg("not", "important")
        def __init__(self, val, important=None):
            self.val = val

cudf.pandas will attempt to proxy Foo.__init__ as an unbound function. Unfortunately when this method is called i.e. Foo(2) we are unable to pass the instance along, self, and call this as Foo.__init__(2).

I'm unsure how we would be able to pass the instance along, so for now I am avoiding proxying these functions (by hackily checking for self in the signature). Open to better solutions

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@mroeschke mroeschke added bug Something isn't working non-breaking Non-breaking change cudf.pandas Issues specific to cudf.pandas labels May 3, 2024
@mroeschke mroeschke requested a review from a team as a code owner May 3, 2024 23:17
@github-actions github-actions bot added the cuDF (Python) Affects Python cuDF API. label May 3, 2024
@mroeschke
Copy link
Contributor Author

Looks like this breaks other functionality so will close for now

@mroeschke mroeschke closed this May 6, 2024
@mroeschke mroeschke deleted the bug/cudf_pandas/function_methods branch May 6, 2024 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cudf.pandas Issues specific to cudf.pandas cuDF (Python) Affects Python cuDF API. non-breaking Non-breaking change
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] Enabling cudf.pandas leads to exception when using a Numpy array
1 participant