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

TYP: misc fixes for numpy types 4 #36102

Closed
wants to merge 4 commits into from

Conversation

simonjayhawkins
Copy link
Member

pandas\plotting\_matplotlib\tools.py:356: error: Incompatible return value type (got "ndarray", expected "Sequence[Any]")  [return-value]
pandas\plotting\_matplotlib\tools.py:358: error: Incompatible return value type (got "Union[ndarray, Any]", expected "Sequence[Any]")  [return-value]
pandas\plotting\_matplotlib\tools.py:359: error: Incompatible return value type (got "ndarray", expected "Sequence[Any]")  [return-value]
pandas\core\dtypes\cast.py:1079: error: No overload variant of "to_datetime" matches argument types "ndarray", "str"  [call-overload]
pandas\core\arrays\categorical.py:1818: error: Signature of "_ndarray" incompatible with supertype "NDArrayBackedExtensionArray"  [override]
pandas/core/arrays/datetimelike.py:465: error: Signature of "_ndarray" incompatible with supertype "NDArrayBackedExtensionArray"  [override]

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Sep 3, 2020
@jreback jreback added this to the 1.2 milestone Sep 5, 2020
_ndarray: np.ndarray
@property
def _ndarray(self) -> np.ndarray:
raise AbstractMethodError(self)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to not prefer an abc here?

@@ -550,7 +550,8 @@ def _adjust_to_origin(arg, origin, unit):


@overload
def to_datetime(
# error: Overloaded function signatures 1 and 3 overlap with incompatible return types
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm do you know why we are getting this error? Seems like an issue with the annotation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since np.ndarray resolves to Any, this will need ignores if merging now b4 the numpy types are available. will close and include in #36092 instead.

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 this pull request may close these issues.

4 participants