-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FFI] Improve error messages when array/map types do not match in function calls #7330
Conversation
The improvement is super helpful! Thanks! |
I've addressed all the review comments. I totally missed |
1e9f3c5
to
4597770
Compare
I think this PR is good to merge once the CI is green |
77e943a
to
75f3a0e
Compare
…ective classes are defined so they will always be found correctly
75f3a0e
to
8830022
Compare
@tqchen @junrushao1994 CI is green for this PR now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @tkonolige for helping improve the error reporting :-)
@tqchen Please take another look and approve explicitly if there is no further issue. I can merge it in only with all reviewers' approval :-) |
…ction calls (apache#7330) * [FIX] Improve error messages when array/map types do not match in function calls * missed some places for renaming * Rename Mismatch to CheckAndGetMismatch. Add Check back in. Use Optional::defined. * Optional<String> -> String * formatting * move ObjectTypeChecker template specializations into where thier respective classes are defined so they will always be found correctly
…ction calls (apache#7330) * [FIX] Improve error messages when array/map types do not match in function calls * missed some places for renaming * Rename Mismatch to CheckAndGetMismatch. Add Check back in. Use Optional::defined. * Optional<String> -> String * formatting * move ObjectTypeChecker template specializations into where thier respective classes are defined so they will always be found correctly
…ction calls (apache#7330) * [FIX] Improve error messages when array/map types do not match in function calls * missed some places for renaming * Rename Mismatch to CheckAndGetMismatch. Add Check back in. Use Optional::defined. * Optional<String> -> String * formatting * move ObjectTypeChecker template specializations into where thier respective classes are defined so they will always be found correctly
…ction calls (apache#7330) * [FIX] Improve error messages when array/map types do not match in function calls * missed some places for renaming * Rename Mismatch to CheckAndGetMismatch. Add Check back in. Use Optional::defined. * Optional<String> -> String * formatting * move ObjectTypeChecker template specializations into where thier respective classes are defined so they will always be found correctly
This PR fixes error messages that arise when a runtime array does not have the correct element types for a function. For example:
Note that because runtime
Array
s are not homogenous, specific elements can fail the type checking. I've added which element fails to the errors message along with its type. This can also happen forMap
s, but I could not figure out a good way to print which element mismatches (because the elements are unordered and I worry printing the key may take too much space).This is a replacement for #7309 that returns the mismatched type when a runtime object cannot be converted.
@jroesch @tqchen @junrushao1994 @rkimball