Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Several generics default to `any` instead of their base type

Open
#192 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
api

Research direction

Start by locating the TypeScript declarations for Field, DataType, and the other generics that default to any in the apache-arrow package. Compare their defaults with their extends constraints, then use the linked TypeScript playground example and existing type tests, if available, to verify that invalid Field type values are rejected.

Written by the indexing model from the issue text.

Description

Type: bug
Describe the bug, including details regarding any error messages, version, and platform.

Several Generics have any set as default value instead of defaulting to the type from which they extend, like the following example:

Field<T extends DataType = any>

Unfortunately this effectively removes all type guarantees when properties that inherit the type are passed down. Example (playground link):

import type {Field, DataType} from "apache-arrow";

"not a type" satisfies Field["type"]; // Does not error
"not a type" satisfies Field<DataType>["type"]; // Errors

The generics should instead define their base type as default type:

Field<T extends DataType = DataType>
Dominant language
TypeScript
Stars
112
Forks
23
Avg merge
17h 55m
Merged PRs (30d)
10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/arrow-js

All issues in apache/arrow-js

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.