Skip to content

Fix type annotations in pandas.tseries.* #26013

Closed
@gwrome

Description

@gwrome

Part of #25882

pandas.tseries files currently have these errors:

pandas/tseries/frequencies.py:40: error: Need type annotation for '_offset_map'

pandas/tseries/holiday.py:332: error: Need type annotation for 'rules'

pandas/tseries/offsets.py:1656: error: Incompatible types in assignment (expression has type "int", base class "QuarterOffset" defined the type as "None")
pandas/tseries/offsets.py:1657: error: Incompatible types in assignment (expression has type "int", base class "QuarterOffset" defined the type as "None")
pandas/tseries/offsets.py:1666: error: Incompatible types in assignment (expression has type "int", base class "QuarterOffset" defined the type as "None")
pandas/tseries/offsets.py:1667: error: Incompatible types in assignment (expression has type "int", base class "QuarterOffset" defined the type as "None")
pandas/tseries/offsets.py:1681: error: Incompatible types in assignment (expression has type "int", base class "QuarterOffset" defined the type as "None")
pandas/tseries/offsets.py:1688: error: Incompatible types in assignment (expression has type "int", base class "QuarterOffset" defined the type as "None")
pandas/tseries/offsets.py:1689: error: Incompatible types in assignment (expression has type "int", base class "QuarterOffset" defined the type as "None")

I have added annotations to address these issues and removed the modules from mypy.ini. PR to follow presently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Typingtype annotations, mypy/pyright type checking

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions