Closed mw25 closed 2 years ago
Thanks for this excellent report. How I wish all reports were so detailed, and also included some debugging and even a test! :)
You are right, of course.
A note to whomever who'd work on this: this shouldn't be too difficult. Copy the idea from widgets that already do it properly, for instance, Discretize and Edit Domain. The latter is better, because it stores changes immediately, not through storeSpecificSettings
.
What's wrong? If first a subset of a table is given to group by (here: only sepal length with Select Columns), and then the remaining variables are added, the aggregations column in the aggregate table is empty. When clicking on the row, a KeyError exception occurs.
How can we reproduce the problem?
Analysis and related problem
A ContextSetting is created with the partial table. With the full table, this context is recognized and the default values of the new variables in self.aggregations (owgroupby) are completely overwritten with the ContextSetting of the partial table. In self.agg_table_view are all variables, but in self.aggregations only one. KeyError.
If a ContextSetting is a dict, it completely replaces the current setting:
https://github.com/biolab/orange-widget-base/blob/51d4f35e2fe807d617aac0547532d220d8942679/orangewidget/settings.py#L201
Wouldn't it be better if:
What's your environment?