Page MenuHomeSoftware Heritage

origin_visit_add: Change return type to OriginVisit
ClosedPublic

Authored by ardumont on Thu, Mar 12, 2:23 PM.

Details

Reviewers
vlorentz
Group Reviewers
Reviewers
Summary

What's really used after that call is the visit object and not the origin one.

Before:

def origin_visit_add(
     self, origin: Origin,
     date: Union[datetime.datetime, str],
     type: str) -> Optional[Dict[str, BaseModel]]:

After:

def origin_visit_add(
        self, origin: Origin,
        date: Union[str, datetime.datetime],
        type: str) -> OriginVisit:

Might as well remove the indirection

Depends on D2820

Test Plan

tox

Diff Detail

Repository
rDSTO Storage manager
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11090
Build 16720: tox-on-jenkinsJenkins
Build 16719: arc lint + arc unit

Event Timeline

ardumont created this revision.Thu, Mar 12, 2:23 PM
vlorentz accepted this revision.Thu, Mar 12, 2:37 PM
vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/storage/cassandra/storage.py
671–673

you should break line earlier, so the return type isn't split in half.

(and why isn't there a corresponding change in interface.py?)

This revision is now accepted and ready to land.Thu, Mar 12, 2:37 PM
ardumont added inline comments.Thu, Mar 12, 2:39 PM
swh/storage/cassandra/storage.py
671–673

i think it's because it's not exposed, it's a cassandra specific one.

ardumont updated this revision to Diff 10018.Thu, Mar 12, 2:48 PM

Fix build

ardumont added inline comments.Thu, Mar 12, 7:49 PM
swh/storage/cassandra/storage.py
671–673

Yes, that's the reason.

Closed in favor of D2820

ardumont closed this revision.Fri, Mar 13, 10:02 AM