Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Type Annotations in pandas.core.arrays #26065

Closed
gwrome opened this issue Apr 12, 2019 · 0 comments · Fixed by #26071
Closed

Fix Type Annotations in pandas.core.arrays #26065

gwrome opened this issue Apr 12, 2019 · 0 comments · Fixed by #26071
Labels
Typing type annotations, mypy/pyright type checking
Milestone

Comments

@gwrome
Copy link
Contributor

gwrome commented Apr 12, 2019

Part of #25882

Errors in pandas.core.arrays

Type annotations for the following files need to be added or corrected to remove those files from the mypy blacklist:

  • pandas.core.arrays.array_.py
  • pandas.core.arrays.datetimelike.py
  • pandas.core.arrays.integer.py
  • pandas.core.arrays.interval.py
  • pandas.core.arrays.period.py
  • pandas.core.arrays.timedeltas.py

I have started working on these and will make PR soon.

Detailed errors are below.

array_.py

pandas/core/arrays/array_.py:232: error: Item "str" of "Union[str, Any, ExtensionDtype, None]" has no attribute "construct_array_type"
pandas/core/arrays/array_.py:232: error: Item "None" of "Union[str, Any, ExtensionDtype, None]" has no attribute "construct_array_type"

datetimelike.py

pandas/core/arrays/datetimelike.py:367: error: "DatetimeLikeArrayMixin" has no attribute "_data"
pandas/core/arrays/datetimelike.py:482: error: Argument 1 to "len" has incompatible type "Union[int, Sequence[int], Sequence[bool], slice]"; expected "Sized"
pandas/core/arrays/datetimelike.py:486: error: Argument 1 to "len" has incompatible type "Union[int, Sequence[int], Sequence[bool], slice]"; expected "Sized"
pandas/core/arrays/datetimelike.py:487: error: Argument 1 to "len" has incompatible type "Union[int, Sequence[int], Sequence[bool], slice]"; expected "Sized"
pandas/core/arrays/datetimelike.py:503: error: Item "Tuple[Type[Any], ...]" of "Union[Type[Any], Tuple[Type[Any]]]" has no attribute "__name__"
pandas/core/arrays/datetimelike.py:505: error: "DatetimeLikeArrayMixin" has no attribute "_data"

integer.py

pandas/core/arrays/integer.py:34: error: Incompatible types in assignment (expression has type "None", base class "ExtensionDtype" defined the type as "str")
pandas/core/arrays/integer.py:36: error: Incompatible types in assignment (expression has type "None", base class "ExtensionDtype" defined the type as "Type[Any]")

interval.py

pandas/core/arrays/interval.py:946: error: Decorated property not supported

period.py

pandas/core/arrays/period.py:139: error: Need type annotation for '_other_ops'
pandas/core/arrays/period.py:193: error: "PeriodDtype" has no attribute "freq"
pandas/core/arrays/period.py:280: error: Read-only property cannot override read-write property
pandas/core/arrays/period.py:550: error: Unsupported operand type for unary - ("Union[ExtensionArray, Any, Any]")
pandas/core/arrays/period.py:787: error: Incompatible types in assignment (expression has type "None", variable has type "PeriodDtype")

timedeltas.py

pandas/core/arrays/timedeltas.py:134: error: Need type annotation for '_other_ops'
pandas/core/arrays/timedeltas.py:135: error: Need type annotation for '_bool_ops'
gwrome added a commit to gwrome/pandas that referenced this issue Apr 12, 2019
@jschendel jschendel added the Typing type annotations, mypy/pyright type checking label Apr 13, 2019
@jreback jreback added this to the 0.25.0 milestone Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants