diff --git a/swh/model/hypothesis_strategies.py b/swh/model/hypothesis_strategies.py --- a/swh/model/hypothesis_strategies.py +++ b/swh/model/hypothesis_strategies.py @@ -157,10 +157,7 @@ visit=integers(1, 1000), origin=urls(), date=aware_datetimes(), - status=sampled_from(["ongoing", "full", "partial"]), type=pgsql_text(), - snapshot=optional(sha1_git()), - metadata=none(), ) diff --git a/swh/model/model.py b/swh/model/model.py --- a/swh/model/model.py +++ b/swh/model/model.py @@ -1,4 +1,4 @@ -# Copyright (C) 2018-2019 The Software Heritage developers +# Copyright (C) 2018-2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -228,21 +228,13 @@ @attr.s(frozen=True) class OriginVisit(BaseModel): - """Represents a visit of an origin at a given point in time, by a + """Represents an origin visit with a given type at a given point in time, by a SWH loader.""" origin = attr.ib(type=str, validator=type_validator()) date = attr.ib(type=datetime.datetime, validator=type_validator()) - status = attr.ib( - type=str, validator=attr.validators.in_(["ongoing", "full", "partial"]) - ) type = attr.ib(type=str, validator=type_validator()) - snapshot = attr.ib(type=Optional[Sha1Git], validator=type_validator()) - metadata = attr.ib( - type=Optional[Dict[str, object]], validator=type_validator(), default=None - ) visit = attr.ib(type=Optional[int], validator=type_validator(), default=None) - """Should not be set before calling 'origin_visit_add()'.""" def to_dict(self): """Serializes the date as a string and omits the visit id if it is