arquero icon indicating copy to clipboard operation
arquero copied to clipboard

Using Apache Arrow Type as a type is not possible in Typescript

Open stopyransky opened this issue 3 years ago • 1 comments

when importing arrow Type from arquero package: import { Type } from 'arquero';

because the Type is exported as a namespace

export default {
  NONE: 0,
  // ... other types here
}

using Type as a type is not possible, typescript will throw error: Cannot use namespace 'Type' as a type.ts(2709)

Instead export Type as enum as in original source in Apache Arrow

stopyransky avatar Dec 06 '21 16:12 stopyransky

Thanks. I'm not a heavy TypeScript user so I didn't run into this earlier. In retrospect, I think having Arquero export the Arrow types was likely a mistake and I might deprecate or remove this in future releases. So ultimately I think the right approach will be to use the types from Arrow itself.

In the meantime, if you have a PR that might address the current issue, I'd be happy to review it.

jheer avatar Dec 16 '21 17:12 jheer