Skip to content

Assorted Typing Fixups in pandas.core.reshape #25934

Closed
@WillAyd

Description

@WillAyd

The tile, merge and concat modules could all be removed from the mypy.ini blacklist if we switch them over to absolute imports per the discussion in #25923

Here's the complete list of errors:

pandas/core/reshape/tile.py:16: error: Module 'pandas' has no attribute 'Categorical'
pandas/core/reshape/tile.py:16: error: Module 'pandas' has no attribute 'Index'
pandas/core/reshape/tile.py:16: error: Module 'pandas' has no attribute 'Interval'
pandas/core/reshape/tile.py:16: error: Module 'pandas' has no attribute 'IntervalIndex'
pandas/core/reshape/tile.py:16: error: Module 'pandas' has no attribute 'Series'
pandas/core/reshape/tile.py:16: error: Module 'pandas' has no attribute 'Timedelta'
pandas/core/reshape/tile.py:16: error: Module 'pandas' has no attribute 'Timestamp'
pandas/core/reshape/tile.py:16: error: Module 'pandas' has no attribute 'to_datetime'
pandas/core/reshape/tile.py:16: error: Module 'pandas' has no attribute 'to_timedelta'
pandas/core/reshape/merge.py:11: error: Module 'pandas._libs' has no attribute 'join'
pandas/core/reshape/merge.py:25: error: Module 'pandas' has no attribute 'Categorical'
pandas/core/reshape/merge.py:25: error: Module 'pandas' has no attribute 'DataFrame'
pandas/core/reshape/merge.py:25: error: Module 'pandas' has no attribute 'Index'
pandas/core/reshape/merge.py:25: error: Module 'pandas' has no attribute 'MultiIndex'
pandas/core/reshape/merge.py:25: error: Module 'pandas' has no attribute 'Series'
pandas/core/reshape/merge.py:25: error: Module 'pandas' has no attribute 'Timedelta'
pandas/core/reshape/concat.py:9: error: Module 'pandas' has no attribute 'DataFrame'
pandas/core/reshape/concat.py:9: error: Module 'pandas' has no attribute 'Index'
pandas/core/reshape/concat.py:9: error: Module 'pandas' has no attribute 'MultiIndex'
pandas/core/reshape/concat.py:9: error: Module 'pandas' has no attribute 'Series'

I'm not 100% sure about the import from pandas._libs so that may be an exception here, but would certainly take a PR for the other two modules at the very least

Metadata

Metadata

Assignees

No one assigned

    Labels

    Typingtype annotations, mypy/pyright type checkinggood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions