Skip to content

Commit

Permalink
#748: update auto-generated column deletion code
Browse files Browse the repository at this point in the history
  • Loading branch information
aschonfeld committed Apr 10, 2023
1 parent d78ff42 commit de5f969
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions dtale/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2340,11 +2340,7 @@ def delete_col(data_id):
data = global_state.get_data(data_id)
data = data[[c for c in data.columns if c not in columns]]
curr_history = global_state.get_history(data_id) or []
curr_history += [
"df = df[[c for c in df.columns if c not in ['{}']]]".format(
"','".join(columns)
)
]
curr_history += ["df = df.drop(columns=['{}'])".format("','".join(columns))]
global_state.set_history(data_id, curr_history)
dtypes = global_state.get_dtypes(data_id)
dtypes = [dt for dt in dtypes if dt["name"] not in columns]
Expand Down Expand Up @@ -2394,7 +2390,7 @@ def edit_cell(data_id):
updated = get_str_arg(request, "updated")
updated_str = updated
curr_settings = global_state.get_settings(data_id)

# make sure to load filtered data in order to get correct row index
data = run_query(
handle_predefined(data_id),
Expand Down

0 comments on commit de5f969

Please sign in to comment.