postgresql: Rename db_to_revision to db_to_optional_revision, and add db_to_revision
which crashes instead.
db_to_revision should be used to convert when selecting directly from tables, and db_to_optional_revision when doing an outer join with the table.
This allows skipping 'assert revision is not None' just to make mypy happy, which I would need to add while implementing #4672 (closed)
Merge request reports
Activity
mentioned in merge request !1026 (merged)
Jenkins job DSTO/gitlab-builds #44 failed .
See Console Output and Coverage Report for more details.202 representation. 203 This is similar to :func:`db_to_revision`, but this returns :const:`None` 204 instead of crashing if the revision does not exist (returned by an outer join). 205 """ 203 206 if db_revision["type"] is None: 204 207 assert all( 205 208 v is None for (k, v) in db_revision.items() if k not in ("id", "parents") 206 209 ) 207 210 return None 208 211 212 return db_to_revision(db_revision) 213 214 215 def db_to_revision(db_revision: Dict[str, Any]) -> Revision: 216 """Convert a database representation of a revision to its swh-model 217 representation.""" changed this line in version 3 of the diff
- Resolved by vlorentz
This test failure is pretty awful, looks like the date field is ignored when the release author is empty?
Either way, the diff itself looks fine.
added 6 commits
-
7b730c26...12ab97a7 - 5 commits from branch
swh/devel:master
- 5c402ef2 - postgresql: Rename db_to_revision to db_to_optional_revision, and add db_to_revision
-
7b730c26...12ab97a7 - 5 commits from branch
enabled an automatic merge when the pipeline for 5c402ef2 succeeds
Jenkins job DSTO/gitlab-builds #61 failed .
See Console Output and Coverage Report for more details.mentioned in merge request !1028 (closed)
Jenkins job DSTO/gitlab-builds #66 failed .
See Console Output and Coverage Report for more details.mentioned in issue #4674 (moved)
mentioned in issue swh-model#4640
added 4 commits
-
7da05067...a4ffd7ba - 2 commits from branch
swh/devel:master
- 7a2249ad - postgresql: Rename db_to_revision to db_to_optional_revision, and add db_to_revision
- 26a4a000 - Mention exceptions in docstrings
-
7da05067...a4ffd7ba - 2 commits from branch
enabled an automatic merge when the pipeline for 26a4a000 succeeds
Jenkins job DSTO/gitlab-builds #70 succeeded .
See Console Output and Coverage Report for more details.