diff --git a/data_transformers/dtransformers.py b/data_transformers/dtransformers.py index d1789a4..9e82779 100644 --- a/data_transformers/dtransformers.py +++ b/data_transformers/dtransformers.py @@ -47,10 +47,16 @@ def __call__(self, *args, **kwargs) -> Tuple[dict, DataFrame]: return transformer_r((final_args, self.f(df=applied_args['df']))) @staticmethod - def convert(f): + def convert(f, name=None, external_sourcelines=None): + if external_sourcelines is None: + external_sourcelines = inspect.getsourcelines(f) + + if name is None: + name = f.__name__ + kwargs = { - 'external_sourcelines': inspect.getsourcelines(f), - 'name': f.__name__ + 'external_sourcelines': external_sourcelines, + 'name': name } params = inspect.signature(f).parameters