Closed WillAyd closed 4 years ago
Yeah, but I still am trying to complete annotating DataFrame. Not getting much time after freelancing as well as working whole day at my full-time job. :relieved: Still I will try to find some time for this too. We might need a master tracker issue (or just use this one) with some checklist of todo modules.
Will look into it after closing #26766 as I feel 26766 should have a higher priority. Also lot of issues from :point_up: will get resolved in 26766.
Sure but I think for general contributors would take PRs for these whenever
Yeah, lot of work in typing, we will need more contributers.
@WillAyd Could I work on this issue?
Sure. I would suggest picking one module to fix for now and submitting a PR for that
Here are failures currently on master. I haven't looked in detail but assume that the degree of difficulty to resolve will vary. PRs to tackle individual modules may be best
no of errors for the relevant modules..
@WillAyd although pandas\core\indexes\multi.py
looks like the worst offender here, 82 of the mypy errors are related to a decorated __new__
method.
even with the deprecate_kwarg
method fixed mypy 0.701, is reporting false positives. upgrading to mypy 0.720 fixes this.
some other errors in other modules disappear too, making the todo list for this issue a little more manageable.
so it might be worth forcing the upgrade to mypy 0.720 for the mypy checks.
we should probably be pinning the mypy version anyway to avoid surprises https://mypy.readthedocs.io/en/latest/existing_code.html#continuous-integration
at the moment, there would be 4 new errors that would break CI https://github.com/pandas-dev/pandas/commit/304351e23d1586e0cc28108aff9a2a8a9fac5bf7
Sounds good. I'm not sure we need to really pin mypy - they release pretty quickly and I think good to stay with the latest as it comes out given this is a dev only dependency. Could revisit if something breaks CI drastically in the future
they release pretty quickly
yes they do on PyPi. but the conda enviroment does not seem to be keeping up.
@WillAyd we now have mypy 0.720 in the ci.
among other benefits we could now use inline configuration https://mypy.readthedocs.io/en/stable/inline_config.html#inline-configuration
this could perhaps keep the setup.cfg file cleaner?
in https://github.com/pandas-dev/pandas/pull/28339/commits/6ea3407fcffe224d0fd57a3420b9b6da952c4c5b a blacklist to enable setting --check-untyped-defs
globally is added.
we could now lockdown using a similar approach to https://github.com/pandas-dev/pandas/pull/28339/commits/c90c4ae7910cf6c76bd802399e133af0493d2a30 and get check_untyped_defs = True
live.
thoughts?
I would actually prefer to have things in setup.cfg rather than per module as it keeps everything in one place
As brought up in a conversation with @simonjayhawkins we might want to consider adding
--check-untyped-defs
to the mypy config file. Right now unannotated functions are skipped so local variable inference and checking is not done until an annotation is added. Working through this flag in advance may lead to less surprises as annotations are addedNote that this can also be enabled globally and per module, so we could prioritize as needed. Docs here:
https://mypy.readthedocs.io/en/latest/config_file.html#untyped-definitions-and-calls
Here are failures currently on master. I haven't looked in detail but assume that the degree of difficulty to resolve will vary. PRs to tackle individual modules may be best
@vaibhavhrt something you may have interest in as well