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

register_verb not working #152

Closed
antonio-yu opened this issue Oct 28, 2022 · 1 comment
Closed

register_verb not working #152

antonio-yu opened this issue Oct 28, 2022 · 1 comment

Comments

@antonio-yu
Copy link

antonio-yu commented Oct 28, 2022

The register_verb doesn't work after I update datar to 0.9.1. It worked with olded version.

from datar.all import * 
from pipda import register_verb
from datar.datasets import mtcars
@register_verb
def copy_to_clipboard(df):
    return df.to_clipboard()

mtcars >> copy_to_clipboard()

TypeError: <lambda>() missing 1 required positional argument: 'fun'
@pwwang
Copy link
Owner

pwwang commented Oct 28, 2022

You need the type to be provided:

from pandas import DataFrame

@register_verb(DataFrame)
def copy_to_clipboard(df):
  ...

@pwwang pwwang closed this as completed Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants