diff --git a/swh/storage/api/client.py b/swh/storage/api/client.py --- a/swh/storage/api/client.py +++ b/swh/storage/api/client.py @@ -162,7 +162,7 @@ def origin_add_one(self, origin): return self.post('origin/add', {'origin': origin}) - def origin_visit_add(self, origin, date, type=None): + def origin_visit_add(self, origin, date, type): return self.post( 'origin/visit/add', {'origin': origin, 'date': date, 'type': type}) diff --git a/swh/storage/in_memory.py b/swh/storage/in_memory.py --- a/swh/storage/in_memory.py +++ b/swh/storage/in_memory.py @@ -1222,12 +1222,9 @@ else: return origin.url - def origin_visit_add(self, origin, date, type=None): + def origin_visit_add(self, origin, date, type): """Add an origin_visit for the origin at date with status 'ongoing'. - For backward compatibility, `type` is optional and defaults to - the origin's type. - Args: origin (Union[int,str]): visited origin's identifier or URL date (Union[str,datetime]): timestamp of such visit @@ -1259,7 +1256,7 @@ visit = OriginVisit( origin=origin, date=date, - type=type or origin.type, + type=type, status=status, snapshot=None, metadata=None, diff --git a/swh/storage/storage.py b/swh/storage/storage.py --- a/swh/storage/storage.py +++ b/swh/storage/storage.py @@ -1211,13 +1211,10 @@ return None @db_transaction() - def origin_visit_add(self, origin, date, type=None, + def origin_visit_add(self, origin, date, type, db=None, cur=None): """Add an origin_visit for the origin at ts with status 'ongoing'. - For backward compatibility, `type` is optional and defaults to - the origin's type. - Args: origin (Union[int,str]): visited origin's identifier or URL date (Union[str,datetime]): timestamp of such visit @@ -1241,9 +1238,6 @@ # FIXME: Converge on iso8601 at some point date = dateutil.parser.parse(date) - if type is None: - type = origin['type'] - visit_id = db.origin_visit_add(origin_id, date, type, cur) if self.journal_writer: