Skip to content

Commit b507c37

Browse files
committed
fix: if_then and switch_expresion calling o infer_expression_type
1 parent 4c0a656 commit b507c37

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/substrait/type_inference.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,11 @@ def infer_expression_type(
191191
elif rex_type == "window_function":
192192
return expression.window_function.output_type
193193
elif rex_type == "if_then":
194-
return infer_expression_type(expression.if_then.ifs[0].then)
194+
return infer_expression_type(expression.if_then.ifs[0].then, parent_schema)
195195
elif rex_type == "switch_expression":
196-
return infer_expression_type(expression.switch_expression.ifs[0].then)
196+
return infer_expression_type(
197+
expression.switch_expression.ifs[0].then, parent_schema
198+
)
197199
elif rex_type == "cast":
198200
return expression.cast.type
199201
elif rex_type == "singular_or_list" or rex_type == "multi_or_list":

0 commit comments

Comments
 (0)