From 78352a89e3ae1a2bb4c6f2c8d40fb06506730215 Mon Sep 17 00:00:00 2001 From: Julio Date: Wed, 14 Dec 2022 13:07:07 -0500 Subject: [PATCH] add transform for df --- nvtabular/workflow/workflow.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nvtabular/workflow/workflow.py b/nvtabular/workflow/workflow.py index b7c52bd5182..312c9e8cdbd 100755 --- a/nvtabular/workflow/workflow.py +++ b/nvtabular/workflow/workflow.py @@ -30,7 +30,7 @@ import pandas as pd from merlin.dag import Graph -from merlin.dag.executors import DaskExecutor +from merlin.dag.executors import DaskExecutor, LocalExecutor from merlin.io import Dataset from merlin.schema import Schema from nvtabular.ops import StatOperator @@ -249,6 +249,12 @@ def _transform_impl(self, dataset: Dataset, capture_dtypes=False): schema=self.output_schema, ) + def _transform_df(self, df): + if not self.graph.output_schema: + raise ValueError("no output schema") + + return LocalExecutor().transform(df, self.output_node, self.output_dtypes) + def save(self, path): """Save this workflow to disk