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

GH1034 Migrate old tests in _json.py to new check(assert(... #1036

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

loicdiridollou
Copy link
Contributor

Simple test migration to the new check(assert_type fashion, no logic change.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

Thanks for doing this clean up. The tests are ones we migrated from another repo when we started this project.

In lines 712 to 722, I think you can convert that to use the check(assert_type(...)) pattern.

In lines 923-924, there is this:

    s: Series
    s = DF.iloc[:, 0]

I think we can leave out the s: Series part because with s = DF.iloc[:, 0], I think the type inference will infer that it is a Series.

@loicdiridollou
Copy link
Contributor Author

Thanks for doing this clean up. The tests are ones we migrated from another repo when we started this project.

In lines 712 to 722, I think you can convert that to use the check(assert_type(...)) pattern.

In lines 923-924, there is this:

    s: Series
    s = DF.iloc[:, 0]

I think we can leave out the s: Series part because with s = DF.iloc[:, 0], I think the type inference will infer that it is a Series.

It is inferred as a Series so I was able to remove it.
For the first one, I addressed those, I missed those since I just addressed when we defined a variable and did not use it anywhere else, if you see any more, feel free to point me there.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

@Dr-Irv Dr-Irv merged commit 779aab6 into pandas-dev:main Nov 19, 2024
10 checks passed
@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Nov 19, 2024

if you see any more, feel free to point me there.

I did a search for : and didn't see anything else, so we're in good shape. Thanks for doing this. We have to clean up some of the other tests as well, but that's not as important as getting coverage for 2.x features, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate tests in io/json/_json.py to the new check(assert_type... style
2 participants