Skip to content

Series.diff returns Series['float'] even for nullable integers #1110

Open
@MarcoGorelli

Description

@MarcoGorelli

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

  1. Provide a minimal runnable pandas example that is not properly checked by the stubs.
  2. Indicate which type checker you are using (mypy or pyright).
  3. Show the error message received from that type checker while checking your example.
import pandas as pd


reveal_type(pd.Series([1,2,3], dtype='Int64').diff())
#  note: Revealed type is "pandas.core.series.Series[builtins.float]"

Please complete the following information:

  • OS: [e.g. Windows, Linux, MacOS] linux
  • OS Version [e.g. 22] 22.04
  • python version 3.12.5
  • version of type checker mypy 1.15
  • version of installed pandas-stubs 2.2.3.241126

Additional context
noticed looking into #1108

Metadata

Metadata

Assignees

No one assigned

    Labels

    NA - MaskedArraysRelated to pd.NA and nullable extension arrays

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions