8000 TYP: misc return type annotations by twoertwein · Pull Request #47558 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

TYP: misc return type annotations #47558

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 4 commits into from
Jul 3, 2022
Merged

TYP: misc return type annotations #47558

merged 4 commits into from
Jul 3, 2022

Conversation

twoertwein
Copy link
Member

After this most of the low hanging return annotations that pyright --createstub pandas finds are in pandas/core (there are still plenty of more tricky return annotations).

xref #47521

@@ -455,7 +455,7 @@ def repr_class(x):
raise_assert_detail(obj, msg, repr_class(left), repr_class(right))


def assert_attr_equal(attr: str, left, right, obj: str = "Attributes"):
def assert_attr_equal(attr: str, left, right, obj: str = "Attributes") -> bool:
Copy link
Member

Choose a reason for hiding this comment

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

We had an issue about this previously (can't find it immediately), but all these assert_* functions should -> None. Since this function isn't publicly documented, happy to just have this refactored to not return bools

Copy link
Member Author

Choose a reason for hiding this comment

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

test_assert_attr_equal_different_nulls uses assert tm.assert_attr_equal("na_value", obj, obj2) but I think this is the only function using the return value

@mroeschke mroeschke added Testing pandas testing functions or related to the test suite Typing type annotations, mypy/pyright type checking labels Jul 1, 2022
@mroeschke mroeschke added this to the 1.5 milestone Jul 1, 2022
@mroeschke
Copy link
Member

Looks like the rebase with main is a little off

@twoertwein
Copy link
Member Author

Looks like the rebase with main is a little off

I fixed it and forced pushed

@jreback jreback merged commit f538568 into pandas-dev:main Jul 3, 2022
@jreback
Copy link
Contributor
jreback commented Jul 3, 2022

thanks @twoertwein

yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
@twoertwein twoertwein deleted the misc_return branch September 21, 2022 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0