Skip to content

DataFrame.from_records() needs better annotations #1334

@Dr-Irv

Description

@Dr-Irv

Describe the bug
DataFrame.from_records() is missing argument annotations and also has columns and exclude incorrect.

To Reproduce

df2 = pd.DataFrame.from_records([[1, 4], [2, 5], [3, 6]], columns=df.columns)

This fails with pyright because columns needs to be ListLike | None not SequenceNotStr[str] | None

Please complete the following information:

  • OS: Windows 11
  • python version 3.11
  • version of type checker 1.1.403 (pyright)
  • version of installed pandas-stubs -development version

Need to fix the stub and also create tests.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions