Skip to content

s.diff reports Series[object] instead of bool for nullable types #1150

Open
@MarcoGorelli

Description

@MarcoGorelli

Describe the bug
the diff overload doesn't seem exactly right for nullable types

To Reproduce

import pandas as pd

s: "pd.Series[bool]" = pd.Series([True, False], dtype='bool[pyarrow]')
reveal_type(s)  # Type of "s" is "Series[bool]"
reveal_type(s.diff())  # Type of "s.diff()" is "Series[type[object]]"

Please complete the following information:

  • OS: [e.g. Windows, Linux, MacOS] linux
  • OS Version [e.g. 22]
  • python version 3.12
  • version of type checker pyright 1.1.396
  • version of installed pandas-stubs 2938805

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions