Skip to content

Commit 52cbd80

Browse files
committed
Fix duplicate_names detection in projections.
Apply the requested changes. Fix pylint error Add code
1 parent 64c51ca commit 52cbd80

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Orange/widgets/visualize/utils/widget.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,10 +707,16 @@ def _manual_move_finish(self, anchor_idx, x, y):
707707
def _get_projection_data(self):
708708
if self.data is None or self.projection is None:
709709
return None
710+
proposed = [a.name for a in self.projection.domain.attributes]
711+
names = get_unique_names(self.data.domain, proposed)
712+
713+
attributes = tuple([a.copy(name=n) for n, a in
714+
zip(names, self.projection.domain.attributes)]) \
715+
if proposed != names else ()
710716
return self.data.transform(
711717
Domain(self.data.domain.attributes,
712718
self.data.domain.class_vars,
713-
self.data.domain.metas + self.projection.domain.attributes))
719+
self.data.domain.metas + attributes))
714720

715721
def commit(self):
716722
super().commit()

0 commit comments

Comments
 (0)