From 970cc268fd86f62eccd1d9138c561260defd9289 Mon Sep 17 00:00:00 2001 From: Argenis Leon Date: Thu, 7 Nov 2019 15:25:05 -0600 Subject: [PATCH] Fix profiling name on copy and rename --- optimus/profiler/profiler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/optimus/profiler/profiler.py b/optimus/profiler/profiler.py index 09bdf605..f5b58f9f 100644 --- a/optimus/profiler/profiler.py +++ b/optimus/profiler/profiler.py @@ -324,6 +324,7 @@ def get_name(_col_name): if rename: for k, v in actions["rename"].items(): profiler_columns[v] = profiler_columns.pop(k) + profiler_columns[v]["name"] = v # Drop Keys for col_names in match_actions_names(drop): @@ -333,7 +334,8 @@ def get_name(_col_name): copy_columns = df.get_meta("transformations.actions.copy") if copy_columns is not None: for source, target in copy_columns.items(): - profiler_columns[target] = profiler_columns[source] + profiler_columns[target] = profiler_columns[source].copy() + profiler_columns[target]["name"]= target # Check is a new column is a copied column new_columns = list(set(new_columns) - set(copy_columns.values())) @@ -393,7 +395,6 @@ def get_name(_col_name): assign(output_columns, "sample", sample, dict) df = df.set_meta(value={}) - print(df.cols.names()) df = df.columns_meta(df.cols.names()) col_names = output_columns["columns"].keys()