Skip to content

TYP: assorted annotations #39798

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

Merged
merged 10 commits into from
Feb 21, 2021
Merged

TYP: assorted annotations #39798

merged 10 commits into from
Feb 21, 2021

Conversation

jbrockmendel
Copy link
Member

Also avoid passing unnecesary arg to libreduction, and use a lower-level sanitize function in sanitize_index

def _take_2d_multi_object(arr, indexer, out, fill_value, mask_info):
def _take_2d_multi_object(
arr: np.ndarray, indexer: np.ndarray, out: np.ndarray, fill_value, mask_info
):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
):
): -> None

(and similarly for some others, while we're here?)

Copy link
Member Author

Choose a reason for hiding this comment

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

im ambivalent about the -> None pattern

Copy link
Contributor

@jreback jreback Feb 13, 2021

Choose a reason for hiding this comment

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

why these are easy to annotate
and make it super obvious what is happening

we should always type void

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated + green

@gfyoung gfyoung added the Typing type annotations, mypy/pyright type checking label Feb 13, 2021
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

looks fine. small comments can be in a followon.

cc @simonjayhawkins for typing

@jreback jreback added this to the 1.3 milestone Feb 15, 2021
@jreback jreback merged commit 935000e into pandas-dev:master Feb 21, 2021
@@ -263,7 +263,7 @@ def _reconstruct_data(
return values


def _ensure_arraylike(values):
def _ensure_arraylike(values) -> ArrayLike:
Copy link
Member

Choose a reason for hiding this comment

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

is_array_like is True for Series and Index so the return type should probably be AnyArrayLike

@jbrockmendel jbrockmendel deleted the ref-sanitize branch February 22, 2021 15:34
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.

5 participants