Page MenuHomeSoftware Heritage

Add return type to get_storage.
AbandonedPublic

Authored by vlorentz on Fri, Jan 24, 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.Fri, Jan 24, 6:12 PM
ardumont requested changes to this revision.Tue, Jan 28, 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.Tue, Jan 28, 2:13 PM
vlorentz added inline comments.Tue, Jan 28, 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.Wed, Jan 29, 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.Wed, Jan 29, 2:35 PM

better error message

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

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