Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-10794

[JS] Typescript Arrowjs Class 'RecordBatch<T>' incorrectly extends base class 'StructVector<T>

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.0.0
    • 7.0.0
    • JavaScript
    • None

    Description

      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.
       
       

      Attachments

        1. Screenshot_1.png
          85 kB
          vikash

        Activity

          People

            Unassigned Unassigned
            vikashsingh009 vikash
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: