pwwang / datar

A Grammar of Data Manipulation in python

Home Page:https://pwwang.github.io/datar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

register_verb not working

antonio-yu opened this issue · comments

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'

You need the type to be provided:

from pandas import DataFrame

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