trxcllnt commented on code in PR #320:
URL: https://github.com/apache/arrow-js/pull/320#discussion_r2484250723
##########
src/vector.ts:
##########
@@ -362,17 +362,21 @@ export class Vector<T extends DataType = any> {
.filter((T: any) => typeof T === 'number' && T !== Type.NONE);
for (const typeId of typeIds) {
- const get = getVisitor.getVisitFnByTypeId(typeId);
- const set = setVisitor.getVisitFnByTypeId(typeId);
- const indexOf = indexOfVisitor.getVisitFnByTypeId(typeId);
-
- visitorsByTypeId[typeId] = { get, set, indexOf };
- vectorPrototypesByTypeId[typeId] = Object.create(proto, {
- ['isValid']: { value: wrapChunkedCall1(isChunkedValid) },
- ['get']: { value:
wrapChunkedCall1(getVisitor.getVisitFnByTypeId(typeId)) },
- ['set']: { value:
wrapChunkedCall2(setVisitor.getVisitFnByTypeId(typeId)) },
- ['indexOf']: { value:
wrapChunkedIndexOf(indexOfVisitor.getVisitFnByTypeId(typeId)) },
- });
+ try {
+ const get = getVisitor.getVisitFnByTypeId(typeId);
+ const set = setVisitor.getVisitFnByTypeId(typeId);
+ const indexOf = indexOfVisitor.getVisitFnByTypeId(typeId);
+
+ visitorsByTypeId[typeId] = { get, set, indexOf };
+ vectorPrototypesByTypeId[typeId] = Object.create(proto, {
+ ['isValid']: { value: wrapChunkedCall1(isChunkedValid) },
+ ['get']: { value:
wrapChunkedCall1(getVisitor.getVisitFnByTypeId(typeId)) },
+ ['set']: { value:
wrapChunkedCall2(setVisitor.getVisitFnByTypeId(typeId)) },
+ ['indexOf']: { value:
wrapChunkedIndexOf(indexOfVisitor.getVisitFnByTypeId(typeId)) },
+ });
+ } catch {
+ continue;
Review Comment:
This is an important function that should not silently fail. What error are
we ignoring here?
--
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]