Unnecessary cloning #428
Labels
cleanup 🧹
Refactorings and other tasks that improve the code
performance 🏃
Speed things up
question
Further information is requested
released
Included in a release
Is your feature request related to a problem?
There seem to be some unnecessary cases of
copy
ing a table in_table.py
.For example,
keep_only_columns
creates a copy of the table, then callsremove_columns(...)
on that copy and returns the result:Implementation keep_only_columns(...):
However,
remove_columns
itself already has to - in accordance to our guidelines - create a copy.Indeed, it does (although very implicitely, by calling
Pandas
'drop
method with the defaultinplace=false
keyword argument):Implementation of remove_columns(...):
Pandas documentation for drop method:
Since
remove_columns
already correctly returns a copy of the table it was called on, it is not clear to me why we need to make an additional copy within outkeep_only_columns
implementation.Am I misunderstanding something?
Desired solution
If these additional copies indeed turn out to be unnecessary: Find all occurences of them and remove them,
Possible alternatives (optional)
If the copies actually turn out to be necessary: Close this issue.
The text was updated successfully, but these errors were encountered: