@@ -48,6 +48,7 @@ class ViewRepresentation(OperatorPlatform, ABC):
4848
4949 column_names : List [str ]
5050 column_set : data_algebra .OrderedSet .OrderedSet
51+ column_types : typing .Optional [Dict [str , type ]]
5152 sources : List [
5253 "ViewRepresentation"
5354 ] # https://www.python.org/dev/peps/pep-0484/#forward-references
@@ -56,6 +57,7 @@ def __init__(
5657 self ,
5758 column_names : List [str ],
5859 * ,
60+ column_types : typing .Optional [Dict [str , type ]] = None ,
5961 sources : List ["ViewRepresentation" ] = None ,
6062 node_name : str ,
6163 ):
@@ -80,6 +82,9 @@ def __init__(
8082 for si in sources :
8183 assert isinstance (si , ViewRepresentation )
8284 self .sources = [si for si in sources ]
85+ self .column_types = None
86+ if column_types is not None :
87+ self .column_types = column_types .copy ()
8388 OperatorPlatform .__init__ (
8489 self , node_name = node_name , column_map = collections .OrderedDict (** column_dict )
8590 )
@@ -593,13 +598,13 @@ def __init__(
593598 column_names ,
594599 qualifiers = None ,
595600 sql_meta = None ,
596- column_types = None ,
601+ column_types : typing . Optional [ Dict [ str , type ]] = None ,
597602 head = None ,
598603 limit_was = None ,
599604 nrows = None ,
600605 ):
601606 ViewRepresentation .__init__ (
602- self , column_names = column_names , node_name = "TableDescription"
607+ self , column_names = column_names , node_name = "TableDescription" , column_types = column_types ,
603608 )
604609 if table_name is None :
605610 self .table_name_was_set_by_user = False
@@ -618,9 +623,6 @@ def __init__(
618623 if isinstance (column_names , str ):
619624 column_names = [column_names ]
620625 self .column_names = [c for c in column_names ]
621- self .column_types = None
622- if column_types is not None :
623- self .column_types = column_types .copy ()
624626 if qualifiers is None :
625627 qualifiers = {}
626628 assert isinstance (qualifiers , dict )
@@ -1730,6 +1732,8 @@ class ConcatRowsNode(ViewRepresentation):
17301732
17311733 def __init__ (self , a , b , * , id_column = "table_name" , a_name = "a" , b_name = "b" ):
17321734 # check set of tables is consistent in both sub-dags
1735+ assert isinstance (a , ViewRepresentation )
1736+ assert isinstance (b , ViewRepresentation )
17331737 a_tables = a .get_tables ()
17341738 b_tables = b .get_tables ()
17351739 common_keys = set (a_tables .keys ()).intersection (b_tables .keys ())
0 commit comments