Page MenuHomeSoftware Heritage

Add return type to get_storage.
AbandonedPublic

Authored by vlorentz on Jan 24 2020, 6:12 PM.

Details

Reviewers
ardumont
Group Reviewers
Reviewers
Summary

Depends on D2587, D2588.

Diff Detail

Repository
rDSTO Storage manager
Branch
get_storage-return-type
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10349
Build 15385: tox-on-jenkinsJenkins
Build 15384: arc lint + arc unit

Event Timeline

vlorentz created this revision.Jan 24 2020, 6:12 PM
ardumont requested changes to this revision.Jan 28 2020, 2:13 PM
ardumont added a subscriber: ardumont.
ardumont added inline comments.
swh/storage/__init__.py
69

mmmph, ugly.
prefer the old version.

Also can't we raise a more explicit message as i remember we do in other part of the stack.

raise ValueError('Unsupported storage. Choices are...')

or something.

This revision now requires changes to proceed.Jan 28 2020, 2:13 PM
vlorentz added inline comments.Jan 28 2020, 2:42 PM
swh/storage/__init__.py
69

prefer the old version.

mypy says doesn't like the old version.

Also can't we raise a more explicit message as i remember we do in other part of the stack.

sure

vlorentz updated this revision to Diff 9276.Jan 29 2020, 12:19 PM

woops, pushed to the wrong diff again (yes, I updated the counter on the whiteboard)

vlorentz updated this revision to Diff 9289.Jan 29 2020, 2:35 PM

better error message

ardumont accepted this revision.Jan 29 2020, 2:52 PM
This revision is now accepted and ready to land.Jan 29 2020, 2:52 PM
vlorentz abandoned this revision.Jan 30 2020, 11:37 AM

Actually, that's a bad idea. It makes mypy refuse backend classes with missing endpoints (even deprecated ones)