trxcllnt commented on code in PR #405:
URL: https://github.com/apache/arrow-js/pull/405#discussion_r2887644428


##########
src/factories.ts:
##########
@@ -149,7 +173,7 @@ function inferType(value: readonly unknown[]): 
dtypes.DataType {
     } else if (arraysCount + nullsCount === value.length) {
         const array = value as Array<unknown>[];
         const childType = inferType(array[array.findIndex((ary) => ary != 
null)]);
-        if (array.every((ary) => ary == null || compareTypes(childType, 
inferType(ary)))) {
+        if (array.every((ary) => ary == null || 
compareTypesForInference(childType, inferType(ary)))) {

Review Comment:
   What if we just passed the dictionaryId down through `inferType`? e.g. 
   ```suggestion
           if (array.every((ary) => ary == null || compareTypes(childType, 
inferType(ary, dtypes.DataType.isDictionary(childType) ? childType.id : 
null)))) {
   ```
   
   Then we could pass the dictionary id into the Dictionary constructor on L142?



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

Reply via email to