Skip to content

Commit

Permalink
Fix order output columns
Browse files Browse the repository at this point in the history
  • Loading branch information
argenisleon committed Nov 8, 2019
1 parent 9358f4d commit b2fe7d3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions optimus/profiler/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,6 @@ def get_name(_col_name):
# Merge old and current profiling
if is_cached:
output_columns["columns"].update(self.output_columns["columns"])
actual_columns = output_columns["columns"]
# Order columns
output_columns["columns"] = OrderedDict(
{_cols_name: actual_columns[_cols_name] for _cols_name in df.cols.names() if
_cols_name in list(actual_columns.keys())})

assign(output_columns, "name", df.get_name(), dict)
assign(output_columns, "file_name", df.get_meta("file_name"), dict)
Expand All @@ -399,6 +394,12 @@ def get_name(_col_name):

assign(output_columns, "sample", sample, dict)

actual_columns = output_columns["columns"]
# Order columns
output_columns["columns"] = dict(OrderedDict(
{_cols_name: actual_columns[_cols_name] for _cols_name in df.cols.names() if
_cols_name in list(actual_columns.keys())}))

df = df.set_meta(value={})
df = df.columns_meta(df.cols.names())

Expand Down

0 comments on commit b2fe7d3

Please sign in to comment.