From 00b6ba29eb7d7496a87522d322fa76fd6b769e49 Mon Sep 17 00:00:00 2001 From: Argenis Leon Date: Fri, 8 Nov 2019 13:03:40 -0600 Subject: [PATCH] Fixed values_to_cols() metadata --- optimus/dataframe/columns.py | 9 +++++++-- optimus/helpers/constants.py | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) 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():