sgilmore10 commented on code in PR #37475:
URL: https://github.com/apache/arrow/pull/37475#discussion_r1310727987
##########
matlab/src/matlab/+arrow/+tabular/RecordBatch.m:
##########
@@ -54,13 +54,17 @@
function arrowArray = column(obj, idx)
import arrow.internal.validate.*
- idx = index.numeric(idx, "int32");
- % TODO: Consider vectorizing column() in the future to support
- % extracting multiple columns at once.
- validateattributes(idx, "int32", "scalar");
-
- args = struct(Index=idx);
- [proxyID, typeID] = obj.Proxy.getColumnByIndex(args);
+ idx = index.numericOrString(idx, "int32");
+
+ if isnumeric(idx)
+ validateattributes(idx, "int32", "scalar");
+ args = struct(Index=idx);
+ [proxyID, typeID] = obj.Proxy.getColumnByIndex(args);
+ else
+ validateattributes(idx, "string", "scalar");
Review Comment:
Same comment as above. You could use an `arguments` block.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]