Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Orange/widgets/data/owfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,8 @@ def apply_domain_edit(self):
domain, cols = self.domain_editor.get_domain(self.data.domain, self.data)
if not (domain.variables or domain.metas):
table = None
elif domain is self.data.domain:
table = self.data
else:
X, y, m = cols
table = Table.from_numpy(domain, X, y, m, self.data.W)
Expand Down
7 changes: 7 additions & 0 deletions Orange/widgets/data/tests/test_owfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,13 @@ def test_no_specified_reader(self):
self.widget.load_data()
self.assertTrue(self.widget.Error.missing_reader.is_shown())

def test_domain_edit_no_changes(self):
self.open_dataset("iris")
data = self.get_output(self.widget.Outputs.data)
# When no changes have been made in the domain editor,
# output data should be the same object (and not recreated)
self.assertTrue(data is self.widget.data)

def test_domain_edit_on_sparse_data(self):
iris = Table("iris").to_sparse()

Expand Down