You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happenned because empty table is also considered false, hence data and data.domain resulted in passing a Table (instead of None or an instance of Domain) when the table was empty.
I'd prefer not to write tests for this, though they'd be trivial. I don't like tests that just replicate a bug. Of course one could say "but you should test that a widget does not crash on empty table", but then we should add such a test to all widgets, not just the four that happenned to have this problem.
I have a couple of issues, not necessarily with this fix, but let's discuss what needs to be solved where.
Merge Data. The first issue is now solved, so when I connect from Pivot Table to Merge Data. But if I connect the second table to Merge Data, a new, but related issue appears.
Traceback (most recent call last):
File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 1010, in __process_next
if self.__process_next_helper(use_max_active=True):
File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 1048, in __process_next_helper
self.process_node(selected_node)
File "/Users/ajda/orange/orange-canvas-core/orangecanvas/scheme/signalmanager.py", line 679, 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 369, 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 1113, in openContext
self.settingsHandler.open_context(self, *a)
File "/Users/ajda/orange/orange3/Orange/widgets/data/owmergedata.py", line 191, in open_context
self._encode_domain(domain1),
File "/Users/ajda/orange/orange3/Orange/widgets/data/owmergedata.py", line 210, in _encode_domain
all_vars = chain(domain.variables, domain.metas)
AttributeError: 'Table' object has no attribute 'variables'
Correlations. Now it reports 0 instances on the input and a warning "At least two instances are needed". Transpose reports None (-). We should decide on one option, IMO.
Create Class. Report None (-) and a warning "Data contains only numeric variables." Shouldn't widgets report "No data on input" or something?
As for whether the widget should report that the data table is empty: I wouldn't, because in this case every widget would have such a warning (or even an error) with the corresponding additional code ... I think a "0" in the summary should suffice, unless some particular widget needs to show a warning -- for instance a widget that need at least two instance and wants to inform the user that a single instance is not enough.
Ok, let's go with a 0. It is just slightly confusing from a user's perspective, since we denote "empty" signals with a dashed line. Here, the line is full. But I agree, people should get used to using the status bar. ;)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes #5323, and the same in three other widgets.
This happenned because empty table is also considered false, hence
data and data.domainresulted in passing aTable(instead ofNoneor an instance ofDomain) when the table was empty.I'd prefer not to write tests for this, though they'd be trivial. I don't like tests that just replicate a bug. Of course one could say "but you should test that a widget does not crash on empty table", but then we should add such a test to all widgets, not just the four that happenned to have this problem.
Includes