-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
TYP: Update type hints for ExtensionArray and ExtensionDtype #39501
Conversation
- method: Optional[Literal["backfill", "bfill", "ffill", "pad"]] = None,
+ method: Optional[Literal[backfill, bfill, ffill, pad]] = None, Looks like a bug in Have updated and pushed a new tag, the version in pandas' pre-commit-config will get updated tomorrow morning as part of the scheduled weekly update |
@Dr-Irv can you update |
Ha! It was just released in pypl on 1/30/21, which is when I pushed this! Waiting for it to be on conda and then will update. |
You can now use |
@MarcoGorelli Has this been done yet? I'm still getting the pre-commit failure |
if you approve/merge #39524 and then rebase/merge, then it'll pass |
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
@simonjayhawkins Updated the PR based on your latest stuff with typing, so now |
Thanks @Dr-Irv for working on this. I would imagine that this PR will be easier to check if we limit the changes to There is a conflict here and I think some other overlaps with other PRs removing the ignores. some of the changes to remove ignores need more discussion than others. If ignores are being removed that's great, if ignores or changed or others added we need to review in more depth. |
some new mypy errors and now also another conflict from a subsequent merge to master related to #39501 (comment) |
I'm not sure that it can be done alone, because
I removed ignores only based on when mypy said they were not needed any more. I don't think I added any ignores. Let me get the current version in a state that goes green. |
I think that while numpy types resolved to all the other changes are related to numpy types now having some meaning. I'm sure these could be done separately (and in smaller chunks) changes to 36 files takes some review, especially as changes are made as other PRs are merged. typing PRs need to be atomic to be easily reviewed.
so maybe a PR for the astype fixes and a PR for the isin fixes? |
If I limit things to |
@simonjayhawkins Latest commit 5bb24d4 still has a variety of changes. It just takes what you merged in and should make it mypy happy. |
I'm going to create a separate PR that is effectively this one, MINUS the astype and isin. |
Things that have been approved/merged
Awaiting approval/merges: Things to do in
|
Looks like you've made some progress on that checklist. Is this PR still active? |
I will change it to draft status, as I'm using it to track the changes I would do after #40421 is approved. Then when I finish the checklist, I'll close this one. |
Is this still the master PR? if so could you merge master so we can monitor progress. and more easily see the outstanding review comments. |
Yes. But I'd prefer to do the merge once #41203, #41251, #41258 and #41513 are merged in so we can see where we are with respect to the comments. |
ok. will close for now. reopen when ready. |
Modifications to reduce error reports from
pyright --verifytypes
related toExtensionArray
andExtensionDtype
.Some notes:
Any
in a number of places, because anExtensionArray
can contain any typenumpy
doesn't have a released version with types,pyright
complains whenever we work withnumpy
types, so for type checking purposes, I redefinenp.dtype
andnp.ndarray
to a dummy type. Whennumpy
1.20 is released, we can most likely remove that. Alternatively, I can find out if there is a way to see ifpyright
has something likeTYPE_CHECKING
to bracket those changes.I anticipate these changes might be controversial, so constructive criticism is welcome!