fix: generalize error message for unsupported functions

This commit is contained in:
Umut
2021-09-29 11:32:22 +03:00
parent c0fa302708
commit 77690fed84
2 changed files with 2 additions and 2 deletions

View File

@@ -157,7 +157,7 @@ def _compile_numpy_function_into_op_graph_internal(
# Make sure the graph can be lowered to MLIR
if not is_graph_values_compatible_with_mlir(op_graph):
raise TypeError("signed integers aren't supported for MLIR lowering")
raise RuntimeError("function you are trying to compile isn't supported for MLIR lowering")
# Update bit_width for MLIR
update_bit_width_for_mlir(op_graph)

View File

@@ -251,7 +251,7 @@ def test_fail_compile(function, input_ranges, list_of_arg_names):
arg_name: EncryptedScalar(Integer(64, True)) for arg_name in list_of_arg_names
}
with pytest.raises(TypeError, match=r"signed integers aren't supported for MLIR lowering"):
with pytest.raises(RuntimeError, match=".*isn't supported for MLIR lowering.*"):
compile_numpy_function_into_op_graph(
function,
function_parameters,