Skip to content

(WIP) TYP: add some obvious -> None to pandas/core #47497

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

Closed

Conversation

MarcoGorelli
Copy link
Member

  • closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

via https://github.com/MarcoGorelli/add-obvious-return-none - adding -> None where possible so at least those functions will be type-checked

there's gonna be a tonne of CI failures so opening as draft for now

@MarcoGorelli MarcoGorelli force-pushed the add-obvious-return-types branch from ace8fa2 to 8bb28f1 Compare June 24, 2022 18:00
@MarcoGorelli MarcoGorelli changed the title (WIP) TYP: add some obvious -> None (WIP) TYP: add some obvious -> None to pandas/core Jun 24, 2022
@MarcoGorelli MarcoGorelli force-pushed the add-obvious-return-types branch from 8bb28f1 to f93f9f3 Compare June 24, 2022 18:06
@twoertwein
Copy link
Member

via https://github.com/MarcoGorelli/add-obvious-return-none - adding -> None where possible so at least those functions will be type-checked

Does this also add None to __init__? Just surprised that no __init__ had missing return annotations :)

Not sure whether it is worth the effort: you could extend your hook to also check pyi files: they have obviously no implementation but at least __init__'s that have no return annotation should probably return None.

If you want to cover non-obvious Nones, you could use pyright: it infers missing return types.

@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Jul 28, 2022
@MarcoGorelli
Copy link
Member Author

Closing for now, this'd need some other adjustments first

@twoertwein
Copy link
Member

Closing for now, this'd need some other adjustments first

Would be great to have it to close #46337

@MarcoGorelli
Copy link
Member Author

Thanks - I hope to be able to address it soonish

@twoertwein
Copy link
Member

Might be great to set up https://github.com/JelleZijlstra/autotyping (I failed to get it running locally)

@twoertwein twoertwein mentioned this pull request Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants