agam opened a new issue #12663:
URL: https://github.com/apache/arrow/issues/12663


   While there are several _versions_ that are Javascript-compatible, the "pure 
Typescript" version fails to type check.
   
   - It is possible to use specific versions, e.g. `@apache-arrow/es2015-umd`.
   
   - It is also possible to use the "umbrella" import `apache-arrow`.
   
   - However, the `@apache-arrow/ts` import fails to type check with `tsc`.
   
   A sample of errors from one file:
   
   ```
   ../../node_modules/@apache-arrow/ts/schema.ts:46:49 - error TS2345: Argument 
of type '(Field<T[keyof T]> | undefined)[]' is not assignable to parameter of 
type 'Field<any>[]'.
     Type 'Field<T[keyof T]> | undefined' is not assignable to type 
'Field<any>'.
       Type 'undefined' is not assignable to type 'Field<any>'.
   
   46         return new Schema<{ [key: string]: K }>(columnIndices.map((i) => 
this.fields[i]).filter(Boolean), this.metadata);
                                                      
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   
   ../../node_modules/@apache-arrow/ts/schema.ts:64:58 - error TS2532: Object 
is possibly 'undefined'.
   
   64                 metadata: mergeMaps(mergeMaps(new Map(), 
curFields[i].metadata), f2.metadata)
                                                               ~~~~~~~~~~~~
   
   ../../node_modules/@apache-arrow/ts/schema.ts:129:22 - error TS2532: Object 
is possibly 'undefined'.
   
   129         const type = field.type;
                            ~~~~~
   ```
   
   (Is there any plan to have the typescript code eventually type-check with 
`tsc` ?)
   


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