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
DM-36974: Clean up mypy annotations in lsst.daf.butler.script #753
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, few minor comments.
from .._butler import Butler | ||
from ..core import ValidationError | ||
|
||
|
||
def configValidate(repo, quiet, dataset_type, ignore): | ||
def configValidate(repo: str, quiet: bool, dataset_type: str, ignore: str) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think dataset_type
and ignore
should be list[str]
, doctring needs some fixing too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. The problem being that we declare the API this calls to accept Iterable[str]
and str
itself matches that type. Grr.
Codecov ReportBase: 85.30% // Head: 85.30% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #753 +/- ##
==========================================
- Coverage 85.30% 85.30% -0.01%
==========================================
Files 260 260
Lines 34385 34424 +39
Branches 5806 5802 -4
==========================================
+ Hits 29333 29366 +33
- Misses 3815 3819 +4
- Partials 1237 1239 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Tuple -> tuple Optional[str] -> str | None etc
4f1d694
to
7d03ce1
Compare
We are supposed to use the return value and not assume internal state change.
We were using annotations in many of the files but allowed mypy to ignore them if they were not in typed functions. This fixes the entire directory so that everything is annotated. Mostly annotations and some very minor code rearrangements to let the annotations work (and some new variables created for the same reason)
Checklist
doc/changes