diff --git a/swh/storage/converters.py b/swh/storage/converters.py --- a/swh/storage/converters.py +++ b/swh/storage/converters.py @@ -38,7 +38,7 @@ return author -def db_to_author(id, fullname, name, email): +def db_to_author(fullname, name, email): """Convert the DB representation of an author to a swh-model author. Args: @@ -51,12 +51,7 @@ dict: a dictionary with four keys: id, fullname, name and email, or None if the id is None """ - - if id is None: - return None - return { - 'id': id, 'fullname': fullname, 'name': name, 'email': email, @@ -208,7 +203,6 @@ representation.""" author = db_to_author( - db_revision['author_id'], db_revision['author_fullname'], db_revision['author_name'], db_revision['author_email'], @@ -220,7 +214,6 @@ ) committer = db_to_author( - db_revision['committer_id'], db_revision['committer_fullname'], db_revision['committer_name'], db_revision['committer_email'], @@ -292,7 +285,6 @@ """ author = db_to_author( - db_release['author_id'], db_release['author_fullname'], db_release['author_name'], db_release['author_email'], diff --git a/swh/storage/db.py b/swh/storage/db.py --- a/swh/storage/db.py +++ b/swh/storage/db.py @@ -298,8 +298,7 @@ 'committer_email', 'metadata', 'synthetic', ] - revision_get_cols = revision_add_cols + [ - 'author_id', 'committer_id', 'parents'] + revision_get_cols = revision_add_cols + ['parents'] def origin_visit_add(self, origin, ts, type, cur=None): """Add a new origin_visit for origin origin at timestamp ts with @@ -782,7 +781,7 @@ 'date_neg_utc_offset', 'name', 'comment', 'synthetic', 'author_fullname', 'author_name', 'author_email', ] - release_get_cols = release_add_cols + ['author_id'] + release_get_cols = release_add_cols def release_get_from_list(self, releases, cur=None): cur = self._cursor(cur) 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 @@ -1688,7 +1688,6 @@ person_id = self._objects[key][0][1] p = self._persons[person_id-1] person.update(p.items()) - person['id'] = person_id @staticmethod def _content_key(content): diff --git a/swh/storage/tests/test_converters.py b/swh/storage/tests/test_converters.py --- a/swh/storage/tests/test_converters.py +++ b/swh/storage/tests/test_converters.py @@ -15,11 +15,10 @@ def test_db_to_author(self): # when actual_author = converters.db_to_author( - 1, b'fullname', b'name', b'email') + b'fullname', b'name', b'email') # then self.assertEqual(actual_author, { - 'id': 1, 'fullname': b'fullname', 'name': b'name', 'email': b'email', @@ -38,11 +37,9 @@ 'type': 'rev', 'directory': b'dir-sha1', 'message': b'commit message', - 'author_id': 'auth-id', 'author_fullname': b'auth-fullname', 'author_name': b'auth-name', 'author_email': b'auth-email', - 'committer_id': 'comm-id', 'committer_fullname': b'comm-fullname', 'committer_name': b'comm-name', 'committer_email': b'comm-email', @@ -55,14 +52,12 @@ self.assertEqual(actual_revision, { 'id': 'revision-id', 'author': { - 'id': 'auth-id', 'fullname': b'auth-fullname', 'name': b'auth-name', 'email': b'auth-email', }, 'date': None, 'committer': { - 'id': 'comm-id', 'fullname': b'comm-fullname', 'name': b'comm-name', 'email': b'comm-email', @@ -88,7 +83,6 @@ 'name': b'release-name', 'comment': b'release comment', 'synthetic': True, - 'author_id': 'auth-id', 'author_fullname': b'auth-fullname', 'author_name': b'auth-name', 'author_email': b'auth-email', @@ -97,7 +91,6 @@ # then self.assertEqual(actual_release, { 'author': { - 'id': 'auth-id', 'fullname': b'auth-fullname', 'name': b'auth-name', 'email': b'auth-email',