diff --git a/optimus/dataframe/columns.py b/optimus/dataframe/columns.py index 1b73e8d9..5a1598e5 100644 --- a/optimus/dataframe/columns.py +++ b/optimus/dataframe/columns.py @@ -2113,10 +2113,15 @@ def join_all(_dfs): # names = before.cols.names(keys, invert=True) # print(names) + pivotDF = pivotDF.preserve_meta(self) df = pivotDF.toDF(*names).cols.fill_na(new_names, 0) - # df.table() + df = df.preserve_meta(self, Actions.VALUES_TO_COLS.value, new_names) + combined.append(df) - return join_all(combined) + + df = join_all(combined) + + return df @add_attr(cols) def string_to_index(input_cols=None, output_cols=None, columns=None): diff --git a/optimus/helpers/constants.py b/optimus/helpers/constants.py index dd0ff66a..abc624ce 100644 --- a/optimus/helpers/constants.py +++ b/optimus/helpers/constants.py @@ -103,6 +103,7 @@ class Actions(Enum): NEST = "nest" UNNEST = "unnest" DROP_ROW = "drop_row" + VALUES_TO_COLS = "values_to_cols" @staticmethod def list():