biolab / orange3

🍊 :bar_chart: :bulb: Orange: Interactive data analysis
https://orangedatamining.com
Other
4.85k stars 1.01k forks source link

Group By: error in the callback function #5917

Closed chourroutm closed 2 years ago

chourroutm commented 2 years ago

What's wrong?

----------------------------- KeyError Exception ------------------------------
Traceback (most recent call last):
  File "/home/chourroutm/.orange-env/lib/python3.8/site-packages/Orange/widgets/data/owgroupby.py", line 384, in __rows_selected
    active_aggregations = [self.aggregations[attr] for attr in selected_attrs]
  File "/home/chourroutm/.orange-env/lib/python3.8/site-packages/Orange/widgets/data/owgroupby.py", line 384, in <listcomp>
    active_aggregations = [self.aggregations[attr] for attr in selected_attrs]
KeyError: DiscreteVariable(name='species', values=('human2', 'mouse2', 'pogona2', 'rat2'), compute_value=Lookup(variable=DiscreteVariable(name='species', values=('human', 'mouse', 'pogona', 'rat')), lookup_table=array([0., 1., 2., 3.])))
-------------------------------------------------------------------------------

How can we reproduce the problem?

It happens in the Group By widget GUI on a field on which I used a Select Rows widget, when I try to change the default behavior, which is 'Concatenate' checked and everything else unchecked. Here, I picked "mouse" and "rat" and thus discarded "human" and "pogona". I tried using Purge Domain on my flow first, but the error kept showing up.

What's your environment?

ajdapretnar commented 2 years ago

I am unable to reproduce this. Could you perhaps try the same workflow on one of the standard datasets (zoo, iris, heart-disease) and see if it still fails? Perhaps attach a screenshot so that we know how to get the error.

chourroutm commented 2 years ago

Hi! As guessed by Marko in #5918, the error was caused by corrupted data: the culprit is among Feature Constructor, Select Columns, Select Rows (with purge) and Edit Domain. I was not able to locate the origin of the corruption (my bad!) or reproduce it with a clean workflow, so I'll close this thread.