-
-
Notifications
You must be signed in to change notification settings - Fork 19.1k
STY: ignore mypy errors #62482
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
STY: ignore mypy errors #62482
Changes from 3 commits
3357468
97df043
eb51152
a46f838
3e5b664
c1d9071
0c54eef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -653,7 +653,7 @@ def _mask_datetimelike_result( | |
axis_mask = mask.any(axis=axis) | ||
# error: Unsupported target for indexed assignment ("Union[ndarray[Any, Any], | ||
# datetime64, timedelta64]") | ||
result[axis_mask] = iNaT # type: ignore[index] | ||
result[axis_mask] = iNaT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can remove the comment here since you removed the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
else: | ||
if mask.any(): | ||
return np.int64(iNaT).view(orig_values.dtype) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3306,13 +3306,13 @@ def write_array( | |
self._handle.create_array( | ||
self.group, | ||
key, | ||
value.asi8, # type: ignore[union-attr] | ||
value.asi8, # type: ignore[attr-defined] | ||
) | ||
|
||
node = getattr(self.group, key) | ||
# error: Item "ExtensionArray" of "Union[Any, ExtensionArray]" has no | ||
# attribute "tz" | ||
node._v_attrs.tz = _get_tz(value.tz) # type: ignore[union-attr] | ||
node._v_attrs.tz = _get_tz(value.tz) # type: ignore[attr-defined] | ||
Comment on lines
3308
to
3313
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add mypy error in comments (both places) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
node._v_attrs.value_type = f"datetime64[{value.dtype.unit}]" | ||
elif lib.is_np_dtype(value.dtype, "m"): | ||
self._handle.create_array(self.group, key, value.view("i8")) | ||
|
@@ -5196,7 +5196,7 @@ def _maybe_convert_for_string_atom( | |
): | ||
if isinstance(bvalues.dtype, StringDtype): | ||
# "ndarray[Any, Any]" has no attribute "to_numpy" | ||
bvalues = bvalues.to_numpy() # type: ignore[union-attr] | ||
bvalues = bvalues.to_numpy() | ||
if bvalues.dtype != object: | ||
return bvalues | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be fixed as follows. (and you can remove the comments in 218-219). Move the
return values
statement after line 220 where it saysvalues = cls.from_sequence ...
and after line 223 thevalues = values.astype...
statement so that it is no longer at the end of the function.If
mypy
still complains on either statement, you need to have a comment in there with themypy
error (as in lines 218-219)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know If I've done what you asked, but ended up having these errors:
Check if the changes are correct please