@@ -589,15 +589,17 @@ def convert_decimals_in_arrow_table(table, description) -> "pyarrow.Table":
589
589
590
590
591
591
def convert_to_assigned_datatypes_in_column_table (column_table , description ):
592
+
593
+ converted_column_table = []
592
594
for i , col in enumerate (column_table ):
593
595
if description [i ][1 ] == "decimal" :
594
- column_table [ i ] = tuple (v if v is None else Decimal (v ) for v in col )
596
+ converted_column_table . append ( tuple (v if v is None else Decimal (v ) for v in col ) )
595
597
elif description [i ][1 ] == "date" :
596
- column_table [i ] = tuple (
598
+ converted_column_table [i ]. append ( tuple (
597
599
v if v is None else datetime .date .fromisoformat (v ) for v in col
598
- )
600
+ ))
599
601
elif description [i ][1 ] == "timestamp" :
600
- column_table [i ] = tuple (
602
+ converted_column_table [i ]. append ( tuple (
601
603
(
602
604
v
603
605
if v is None
@@ -606,9 +608,11 @@ def convert_to_assigned_datatypes_in_column_table(column_table, description):
606
608
)
607
609
)
608
610
for v in col
609
- )
611
+ ))
612
+ else :
613
+ converted_column_table .append (col )
610
614
611
- return column_table
615
+ return converted_column_table
612
616
613
617
614
618
def convert_column_based_set_to_arrow_table (columns , description ):
@@ -624,7 +628,7 @@ def convert_column_based_set_to_arrow_table(columns, description):
624
628
625
629
def convert_column_based_set_to_column_table (columns , description ):
626
630
column_names = [c [0 ] for c in description ]
627
- column_table = [_covert_column_to_list (c ) for c in columns ]
631
+ column_table = [_convert_column_to_list (c ) for c in columns ]
628
632
629
633
return column_table , column_names
630
634
@@ -653,8 +657,8 @@ def _convert_column_to_arrow_array(t_col):
653
657
raise OperationalError ("Empty TColumn instance {}" .format (t_col ))
654
658
655
659
656
- def _covert_column_to_list (t_col ):
657
- supported_field_types = (
660
+ def _convert_column_to_list (t_col ):
661
+ SUPPORTED_FIELD_TYPES = (
658
662
"boolVal" ,
659
663
"byteVal" ,
660
664
"i16Val" ,
@@ -665,7 +669,7 @@ def _covert_column_to_list(t_col):
665
669
"binaryVal" ,
666
670
)
667
671
668
- for field in supported_field_types :
672
+ for field in SUPPORTED_FIELD_TYPES :
669
673
wrapper = getattr (t_col , field )
670
674
if wrapper :
671
675
return _create_python_tuple (wrapper )
0 commit comments