diff --git a/evadb/models/storage/batch.py b/evadb/models/storage/batch.py index 2ab15a91a..dd076b9ed 100644 --- a/evadb/models/storage/batch.py +++ b/evadb/models/storage/batch.py @@ -173,7 +173,7 @@ def apply_function_expression(self, expr: Callable) -> Batch: """ Execute function expression on frames. """ - if hasattr(expr.forward, "tags"): + if hasattr(expr.forward, "tags") and (len(expr.forward.tags) != 0): input_tags = expr.forward.tags["input"][0] output_tags = expr.forward.tags["output"][0] self.drop_column_alias(metadata=(input_tags, output_tags)) @@ -511,6 +511,7 @@ def deduce_and_map_type(element, check_type): } flexible_type_mapping = { NdArrayType.INT8: [ + NdArrayType.INT8, NdArrayType.INT16, NdArrayType.INT32, NdArrayType.INT64, @@ -518,6 +519,8 @@ def deduce_and_map_type(element, check_type): NdArrayType.FLOAT64, ], NdArrayType.UINT8: [ + NdArrayType.UINT8, + NdArrayType.INT8, NdArrayType.INT16, NdArrayType.INT32, NdArrayType.INT64, @@ -526,6 +529,7 @@ def deduce_and_map_type(element, check_type): ], NdArrayType.INT16: [ NdArrayType.INT8, + NdArrayType.INT16, NdArrayType.INT32, NdArrayType.INT64, NdArrayType.FLOAT32, @@ -534,31 +538,21 @@ def deduce_and_map_type(element, check_type): NdArrayType.INT32: [ NdArrayType.INT8, NdArrayType.INT16, + NdArrayType.INT32, NdArrayType.INT64, NdArrayType.FLOAT32, NdArrayType.FLOAT64, ], NdArrayType.INT64: [ - NdArrayType.INT8, - NdArrayType.INT16, - NdArrayType.INT32, - NdArrayType.FLOAT32, - NdArrayType.FLOAT64, - ], - NdArrayType.FLOAT32: [ - NdArrayType.FLOAT64, NdArrayType.INT8, NdArrayType.INT16, NdArrayType.INT32, NdArrayType.INT64, - ], - NdArrayType.FLOAT64: [ NdArrayType.FLOAT32, - NdArrayType.INT8, - NdArrayType.INT16, - NdArrayType.INT32, - NdArrayType.INT64, + NdArrayType.FLOAT64, ], + NdArrayType.FLOAT32: [NdArrayType.FLOAT64, NdArrayType.FLOAT32], + NdArrayType.FLOAT64: [NdArrayType.FLOAT64, NdArrayType.FLOAT32], } element_type = type(element) if isinstance(element, int): @@ -579,11 +573,10 @@ def deduce_and_map_type(element, check_type): if deduced_type == check_type: return True if ( - deduced_type in flexible_type_mapping + deduced_type is not None and check_type in flexible_type_mapping[deduced_type] ): return True - return False for col_name in self.columns: