biolab / orange3

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

Merge Data: settings error (missing 'attr_pairs') #4870

Closed ajdapretnar closed 4 years ago

ajdapretnar commented 4 years ago

Bug reports that do not sufficiently describe a bug are not helpful and will most likely be ignored. ⬇️ I know, working on it.

I found a bug with Merge Data, but I can't reproduce it for now. It's a settings issue, obviously, but don't know what I did to make this happen. It happened twice, so I think eventually I will remember what could be wrong.

Traceback (most recent call last):
  File "/Users/ajda/opt/miniconda3/envs/o3/lib/python3.8/site-packages/orangecanvas/scheme/signalmanager.py", line 936, in __process_next
    if self.__process_next_helper(use_max_active=True):
  File "/Users/ajda/opt/miniconda3/envs/o3/lib/python3.8/site-packages/orangecanvas/scheme/signalmanager.py", line 974, in __process_next_helper
    self.process_node(selected_node)
  File "/Users/ajda/opt/miniconda3/envs/o3/lib/python3.8/site-packages/orangecanvas/scheme/signalmanager.py", line 605, in process_node
    self.send_to_node(node, signals_in)
  File "/Users/ajda/opt/miniconda3/envs/o3/lib/python3.8/site-packages/orangewidget/workflow/widgetsscheme.py", line 792, in send_to_node
    self.process_signals_for_widget(node, widget, signals)
  File "/Users/ajda/opt/miniconda3/envs/o3/lib/python3.8/site-packages/orangewidget/workflow/widgetsscheme.py", line 833, in process_signals_for_widget
    widget.handleNewSignals()
  File "/Users/ajda/orange/orange3/Orange/widgets/data/owmergedata.py", line 364, in handleNewSignals
    self.openContext(self.data and self.data.domain,
  File "/Users/ajda/opt/miniconda3/envs/o3/lib/python3.8/site-packages/orangewidget/widget.py", line 994, in openContext
    self.settingsHandler.open_context(self, *a)
  File "/Users/ajda/orange/orange3/Orange/widgets/data/owmergedata.py", line 190, in open_context
    super().open_context(widget,
  File "/Users/ajda/opt/miniconda3/envs/o3/lib/python3.8/site-packages/orangewidget/settings.py", line 816, in open_context
    self.find_or_create_context(widget, *args)
  File "/Users/ajda/opt/miniconda3/envs/o3/lib/python3.8/site-packages/orangewidget/settings.py", line 848, in find_or_create_context
    best_context, best_score = self.find_context(self.global_contexts, args,
  File "/Users/ajda/opt/miniconda3/envs/o3/lib/python3.8/site-packages/orangewidget/settings.py", line 868, in find_context
    score = self.match(context, *args)
  File "/Users/ajda/orange/orange3/Orange/widgets/data/owmergedata.py", line 235, in match
    left, right = zip(*context.values["attr_pairs"])
KeyError: 'attr_pairs'
janezd commented 4 years ago

Duplicate of #4859 (which was closed unsolved, because @Hrovatin was unable to reproduce it, too).

Now she reported she can (oersonal communication, on Slack). It probably involves renaming attributes using Edit Domain.

ajdapretnar commented 4 years ago

I'm so out I didn't notice it was reported before. 🙈 Now I remember.

I've tried renaming attrs in Edit Domain and it worked fine. I've tried changing attribute type and it worked fine. Hence my confusion as to how to reproduce it. Will try some more.

Hrovatin commented 4 years ago

I have two datasets, both with feature Cluster. I merge these two datasets - that works fine. Then I merge this merged dataset to another dataset - this is when I get errors. If I leave Cluster feature names as they are it works fine (they get renamed to Cluster (1) and Cluster (2). If I rename them to Cluster AX4 and Cluster All before merging the initial two datasets I then get error in the second merge data. However, the error is different than the one above (see images).

Screenshot from 2020-06-29 11-18-30 Screenshot from 2020-06-29 11-16-10

I get the above error if I change data on merge data input (e.g. change setting in select rows that is before the merge data) or when I open a workflow - for some reason it often does not remember which features I used for merging data. I have sent you the example workflow and data to slack.

janezd commented 4 years ago

You have found many well-hidden bugs and proposed many useful changes. Kudos for that. There is one problem, though: could you replicate this with a smaller workflow? Bonus points for not requiring add-ons? This would usually be of great help to the person who fixes the bug. (S)He'll need to get to the source of it by eliminating the redundant elements. You, who encountered the bug in the first place, may be the most qualified to do this half of the work. If nothing else, I suppose the problem starts at the later stage in the workflow, so you can replace most of the workflow by just saving the intermediary data.

Hrovatin commented 4 years ago

I have made a single workflow that shows both errors. This works:

Screenshot from 2020-06-30 11-43-48

Then I change the name of one of the features and get attr error. I need to reset what I am merging by, despite that variable not being changed.

Screenshot from 2020-06-30 11-44-03

Then I get the second error in the next Merge Data widget, the data can't go through (see the Data Table, the clusters are still named as they were before changing the one of the to Cluster AX4).

Screenshot from 2020-06-30 11-44-26

PrimozGodec commented 4 years ago

@Hrovatin where can we find data that use used in the last workflow (regulons and averaged data)?

Hrovatin commented 4 years ago

I sent it on Slack, I am not sure if it is the same data though, as this was long ago.

ajdapretnar commented 4 years ago

@PrimozGodec I think I found them. Let me know since we can't share it here.