Open aarondr77 opened 10 months ago
To get optimized code, we need to call optimize_code_chunks
which takes a list of all code chunks and returns an optimized like of code chunks.
It's not obvious that we could just create a new step list from the steps we collect in get_optional_code_to_replay_on_pivot
because the post_state and prev_state would not match whenever there is a step in between that does not edit the pivot table.
However, those steps don't matter for the calculating the state of the pivot table, unless there is a VLOOKUP function in the pivot table that needs to access data from another sheet.
Does the post_state need to match the prev_state of the next step in order to generate correct code? I don't think so. If we just used the prev_state and post_state that is stored in the original step list we would get the correct code. I think ...
This should be at least improved by #1115
values
To fix, if an add column event fails, just add the column using
df['New Column Name'] = 0
to add it to the end of the table by default. We would want to handle this inside of the add column step performer.