Skip to content

concat does not respect Series.dtype #1300

@cmp0xff

Description

@cmp0xff

Describe the bug
Concatenating Series of the same dtype leads to Series[Any].

To Reproduce

  1. Provide a minimal runnable pandas example that is not properly checked by the stubs.
    from typing import reveal_type
    
    import pandas as pd
    
    reveal_type(pd.concat([pd.Series([1, 2]), pd.Series([3, 4])]).dtype)
  2. Indicate which type checker you are using (mypy or pyright).
    pyright
  3. Show the error message received from that type checker while checking your example.
    concat.py:5:13 - information: Type of "pd.concat([pd.Series([1, 2]), pd.Series([3, 4])])" is "Series[Any]"
    

Please complete the following information:

  • OS: Windows
  • OS Version: 11
  • python version: 3.13.4
  • version of type checker: 1.1.403
  • version of installed pandas-stubs: 2.3.0.250703

Additional context
None

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