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

DM-33271: Fix mypy warnings with 0.931 #631

Merged
merged 12 commits into from Jan 15, 2022
Merged

DM-33271: Fix mypy warnings with 0.931 #631

merged 12 commits into from Jan 15, 2022

Conversation

timj
Copy link
Member

@timj timj commented Jan 14, 2022

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Not all the cases where str+ResourcePath were converted
to ResourcePathExpression were correct and some were
missed.
mypy can't tell the type returned by a getattr so an
assert must be included.
types.Mapping expects .keys() to return KeysView but
these classes return an AbstractSet. The set is compatible
with KeysView to the extent we need but KeysView is
a concrete class and not an abstract one so it is not
desirable to involve it. For now this means we ignore
the warning.
FileDataset always assumed this was mandatory but this was
only just enforced.
@codecov
Copy link

codecov bot commented Jan 14, 2022

Codecov Report

Merging #631 (f774ee9) into main (8f7140c) will decrease coverage by 0.00%.
The diff coverage is 82.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #631      +/-   ##
==========================================
- Coverage   84.11%   84.11%   -0.01%     
==========================================
  Files         237      237              
  Lines       30138    30143       +5     
  Branches     5014     5014              
==========================================
+ Hits        25351    25354       +3     
- Misses       3643     3645       +2     
  Partials     1144     1144              
Impacted Files Coverage Δ
python/lsst/daf/butler/core/dimensions/_skypix.py 87.77% <0.00%> (-2.00%) ⬇️
python/lsst/daf/butler/datastores/fileDatastore.py 80.33% <ø> (ø)
python/lsst/daf/butler/registries/remote.py 0.00% <ø> (ø)
python/lsst/daf/butler/registries/sql.py 81.58% <ø> (ø)
python/lsst/daf/butler/registry/_registry.py 72.47% <ø> (ø)
...ython/lsst/daf/butler/registry/dimensions/table.py 84.41% <0.00%> (ø)
python/lsst/daf/butler/_butler.py 81.10% <100.00%> (ø)
python/lsst/daf/butler/_butlerRepoIndex.py 95.55% <100.00%> (+0.10%) ⬆️
python/lsst/daf/butler/core/_butlerUri.py 96.15% <100.00%> (+0.15%) ⬆️
...hon/lsst/daf/butler/core/dimensions/_coordinate.py 85.40% <100.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f7140c...f774ee9. Read the comment docs.

Some versions of mypy get upset with the return type for
ButlerURI.__new__ not being ButlerURI. Others do not complain.
Since this is purely a compatibility layer, configure mypy
to ignore the errors if they happen.
@timj timj requested a review from TallJimbo January 14, 2022 22:30
@timj timj merged commit 90f5a21 into main Jan 15, 2022
@timj timj deleted the tickets/DM-33271 branch January 15, 2022 00:30
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.

None yet

2 participants