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

[JS] Overly broad type annotation for Chunked typeId leading to type mismatches in generated typing

    XMLWordPrintableJSON

Details

    Description

      Typescript isĀ generatingĀ an overly broad type for the `typeId` property of the ChunkedVector class, leading to a type mismatch and failure to infer Column<T> is Vector<T>:

      
      let col: Vector<Utf8>;
      col = new Chunked(new Utf8());
        ^
      /*
      Argument of type 'Chunked<Utf8>' is not assignable to parameter of type 'Vector<Utf8>'.
        Type 'Chunked<Utf8>' is not assignable to type 'Vector<Utf8>'.
          Types of property 'typeId' are incompatible.
            Type 'Type' is not assignable to type 'Type.Utf8'.
      */
      

      The fix is to add an explicit return annotation to the Chunked typeId getter.

      Attachments

        Issue Links

          Activity

            People

              paul.e.taylor Paul Taylor
              paul.e.taylor Paul Taylor
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m