From b12ea8d27a506becb46b485cb4fe73ecb20bab6a Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Sat, 6 Jun 2015 14:15:47 +0200 Subject: [PATCH] Raise exception for duplicated attrs in projection Rather than ignoring them, raise an exception --- relational/relation.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/relational/relation.py b/relational/relation.py index 3e8632f..8c9cc17 100644 --- a/relational/relation.py +++ b/relational/relation.py @@ -153,11 +153,8 @@ class relation (object): attributes = attributes[0] # Avoiding duplicated attributes - attributes1 = [] - for i in attributes: - if i not in attributes1: - attributes1.append(i) - attributes = attributes1 + if len(set(attributes)) != len (attributes): + raise Exception('Duplicated attributes in projection') ids = self.header.getAttributesId(attributes)