Skip to content
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

[MATLAB] arrow.internal.proxy.validate throws an MATLAB:UndefinedFunction when crafting the message to display when throwing the arrow:proxy:ProxyNameMismatch error #37245

Closed
sgilmore10 opened this issue Aug 18, 2023 · 0 comments · Fixed by #37248

Comments

@sgilmore10
Copy link
Member

sgilmore10 commented Aug 18, 2023

Describe the bug, including details regarding any error messages, version, and platform.

When constructing the message to display with the arrow:proxy:ProxyNameMismatch error, we refer to an undefined variable in arrow.internal.proxy.validate(). This causes the function to thrown a MATLAB:UndefinedFunction error instead of the intended one.

Here's an example of this bug:

>> 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:

>> 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

Component(s)

MATLAB

kevingurney pushed a commit that referenced this issue Aug 18, 2023
…efinedFunction` when crafting the message to display when throwing the `arrow:proxy:ProxyNameMismatch` error (#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: #37245

Authored-by: Sarah Gilmore <sgilmore@mathworks.com>
Signed-off-by: Kevin Gurney <kgurney@mathworks.com>
@kevingurney kevingurney added this to the 14.0.0 milestone Aug 18, 2023
loicalleyne pushed a commit to loicalleyne/arrow that referenced this issue Nov 13, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment