From 4c101526e62500bd68902851e30a7a0fd25cc883 Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Sun, 23 Aug 2020 11:16:12 +0200 Subject: [PATCH] Use None instead o a special string --- relational/relation.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/relational/relation.py b/relational/relation.py index 87dc90b..832afe1 100644 --- a/relational/relation.py +++ b/relational/relation.py @@ -276,9 +276,7 @@ class Relation(NamedTuple): def outer_right(self, other: 'Relation') -> 'Relation': ''' Outer right join. Considers self as left and param as right. If the - tuple has no corrispondence, empy attributes are filled with a "---" - string. This is due to the fact that the None token would cause - problems when saving and reloading the relation. + tuple has no corrispondence, empy attributes are filled with a None. Just like natural join, it works considering shared attributes. ''' return other.outer_left(self) @@ -287,7 +285,6 @@ class Relation(NamedTuple): ''' See documentation for outer_right ''' - shared = self.header.intersection(other.header) # Creating the header with all the fields, done like that because order is @@ -319,7 +316,7 @@ class Relation(NamedTuple): added = True # If it didn't partecipate, adds it if not added: - item = chain(i, repeat('---', len(noid))) #FIXME + item = chain(i, repeat(None, len(noid))) #FIXME content.append(tuple(item)) return Relation(header, frozenset(content))