Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-37245: [MATLAB]
arrow.internal.proxy.validate
throws `MATL…
…AB:UndefinedFunction` when crafting the message to display when throwing the `arrow:proxy:ProxyNameMismatch` error (apache#37248) ### Rationale for this change When constructing the message to display for with the `arrow:proxy:ProxyNameMismatch` error, we refer to an undefined variable in `arrow.internal.proxy.validate()`. This causes the function to throw a `MATLAB:UndefinedFunction` error instead of the intended one. Here's an example of this bug: ```matlab >> a = arrow.array([1 2 3]); >> arrow.internal.proxy.validate(a.Proxy, "WrongProxyName") Unrecognized function or variable 'proxyName'. Error in arrow.internal.proxy.validate (line 26) msg = "Proxy class name is " + proxyName + ", but expected " + expectedProxyName; ``` This was the expected error message: ```matlab >> a = arrow.array([1 2 3]); >> arrow.internal.proxy.validate(a.Proxy, "WrongProxyName") Error using arrow.internal.proxy.validate Proxy class name is arrow.array.proxy.Float64Array, but expected WrongProxyName ``` ### What changes are included in this PR? 1. Fixed the typos in `arrow.internal.proxy.validate()` to resolve the `MATLAB:UndefinedFunction` error 2. Added a new test class `test/arrow/internal/proxy/tValidate.m` to test `arrow.internal.proxy.validate()` 3. Updated the error message to display when throwing an `arrow:proxy:ProxyNameMismatch` error: ```matlab >> a = arrow.array([1 2 3]); >> arrow.internal.proxy.validate(a.Proxy, "WrongProxyName") Error using arrow.internal.proxy.validate The Name property of the Proxy provided is "arrow.array.proxy.Float64Array", but expected it to be "WrongProxyName". ``` ### Are these changes tested? Yes, added a new test class `test/arrow/internal/proxy/tValidate.m`. ### Are there any user-facing changes? No. * Closes: apache#37245 Authored-by: Sarah Gilmore <sgilmore@mathworks.com> Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
- Loading branch information