You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Paul Taylor (Jira)" <ji...@apache.org> on 2021/02/05 06:18:00 UTC

[jira] [Commented] (ARROW-10794) Typescript Arrowjs Class 'RecordBatch' incorrectly extends base class 'StructVector

    [ https://issues.apache.org/jira/browse/ARROW-10794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17279379#comment-17279379 ] 

Paul Taylor commented on ARROW-10794:
-------------------------------------

Thanks for reporting, I'll look into submitting a PR to fix these. In the meantime, you should be able to set `"skipLibCheck": true` in your tsconfig to workaround this.

> Typescript Arrowjs Class 'RecordBatch<T>' incorrectly extends base class 'StructVector<T>
> -----------------------------------------------------------------------------------------
>
>                 Key: ARROW-10794
>                 URL: https://issues.apache.org/jira/browse/ARROW-10794
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: JavaScript
>    Affects Versions: 2.0.0
>            Reporter: vikash
>            Priority: Blocker
>         Attachments: Screenshot_1.png
>
>
> i  am  trying  to  use apache-arrow  js  in  angular typescript version 
> 4.0.2 ,for that  i have  seen  issues  in  Typescript  failed  to  compile
>  steps  to  reprodcue
> ---------------------
> 1) install  angular cli  npm install -g @angular/cli
> 2) create  new  project  using ng new my-app
> 3) install apache  arrow  using  npm install apache-arrow
> 4) file  app.componenet.ts have  added below code
> ```
> import \{ Component } from '@angular/core';
> import \{ Table } from 'apache-arrow';
> import \{ readFileSync } from 'fs';
> @Component({
>   selector: 'app-root',
>   templateUrl: './app.component.html',
>   styleUrls: ['./app.component.css']
> })
> export class AppComponent {
>   title = 'arrow-typescript';
>    arrow = readFileSync('simple.arrow');
>  table = Table.from([this.arrow]);
> }
> ```
>  
> but  when  i  am  using  npm  run  build  its  failed  with  below  error
> Error: node_modules/apache-arrow/recordbatch.d.ts:17:18 - error TS2430: Interface 'RecordBatch<T>' incorrectly extends interface 'StructVector<T>'.
>  The types of 'slice(...).clone' are incompatible between these types.
>  Type '(data: Data<Struct<T>>, children?: AbstractVector<any>[] | undefined) => RecordBatch<T>' is not assignable to type '<R extends DataType<Type, any> = Struct<T>>(data: Data<R>, children?: AbstractVector<R>[] | undefined) => VectorType<R>'.
>  Types of parameters 'data' and 'data' are incompatible.
>  Type 'Data<R>' is not assignable to type 'Data<Struct<T>>'.
>  Type 'R' is not assignable to type 'Struct<T>'.
>  Property 'dataTypes' is missing in type 'DataType<Type, any>' but required in type 'Struct<T>'.
> 17 export interface RecordBatch<T extends {
>  ~~~~~~~~~~~
> node_modules/apache-arrow/type.d.ts:458:5
>  458 dataTypes: T;
>  ~~~~~~~~~
>  'dataTypes' is declared here.
> node_modules/apache-arrow/recordbatch.d.ts:24:22 - error TS2415: Class 'RecordBatch<T>' incorrectly extends base class 'StructVector<T>'.
> 24 export declare class RecordBatch<T extends {
>  ~~~~~~~~~~~
> node_modules/apache-arrow/ipc/reader.d.ts:236:5 - error TS2717: Subsequent property declarations must have the same type. Property 'schema' must be of type 'Schema<T>', but here has type 'Schema<any>'.
> 236 schema: Schema;
>  ~~~~~~
> node_modules/apache-arrow/ipc/reader.d.ts:189:5
>  189 schema: Schema<T>;
>  ~~~~~~
>  'schema' was also declared here.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)