Skip to content

Commit

Permalink
check for empty tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Yifei Wang authored and Yifei Wang committed Nov 25, 2023
1 parent bc0da72 commit 9fd26f5
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions evadb/models/storage/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -511,13 +511,16 @@ def deduce_and_map_type(element, check_type):
}
flexible_type_mapping = {
NdArrayType.INT8: [
NdArrayType.INT8,
NdArrayType.INT16,
NdArrayType.INT32,
NdArrayType.INT64,
NdArrayType.FLOAT32,
NdArrayType.FLOAT64,
],
NdArrayType.UINT8: [
NdArrayType.UINT8,
NdArrayType.INT8,
NdArrayType.INT16,
NdArrayType.INT32,
NdArrayType.INT64,
Expand All @@ -526,6 +529,7 @@ def deduce_and_map_type(element, check_type):
],
NdArrayType.INT16: [
NdArrayType.INT8,
NdArrayType.INT16,
NdArrayType.INT32,
NdArrayType.INT64,
NdArrayType.FLOAT32,
Expand All @@ -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):
Expand All @@ -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:
Expand Down

0 comments on commit 9fd26f5

Please sign in to comment.