Skip to content

STYLE, TYP frame-or-series-union check no longer relevant #40876

Closed
@MarcoGorelli

Description

@MarcoGorelli

This check is no longer relevant:

- id: frame-or-series-union
name: Check for use of Union[Series, DataFrame] instead of FrameOrSeriesUnion alias
entry: Union\[.*(Series,.*DataFrame|DataFrame,.*Series).*\]
language: pygrep
types: [python]
exclude: ^pandas/_typing\.py$

Since using PEP604 rewrites, this would be written as

x: Series | DataFrame

anyway.

x: FrameOrSeriesUnion

is actually just as long as the above, and arguably less explicit.


@simonjayhawkins thoughts on replacing all the FrameOrSeriesUnion occurrences, removing the alias, and removing the above check?

Metadata

Metadata

Assignees

Labels

Code StyleCode style, linting, code_checksTypingtype annotations, mypy/pyright type checkinggood first issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions