Skip to content

Commit

Permalink
Fix profiling name on copy and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
argenisleon committed Nov 7, 2019
1 parent 127b0b9 commit 970cc26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions optimus/profiler/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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()))

Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 970cc26

Please sign in to comment.