Skip to content

Commit 21c3cd2

Browse files
committed
fixed mypy error
1 parent 92c961e commit 21c3cd2

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

search/process/transform.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _constructACMClass(meta: DocMeta) -> Optional[list]:
4444

4545
def _transformAuthor(author: dict) -> Optional[Dict]:
4646
if (not author['last_name']) and (not author['first_name']):
47-
return None
47+
return None
4848
author['full_name'] = re.sub(r'\s+', ' ', f"{author['first_name']} {author['last_name']}")
4949
author['initials'] = [pt[0] for pt in author['first_name'].split() if pt]
5050
# initials = ' '.join(author["initials"])
@@ -54,11 +54,21 @@ def _transformAuthor(author: dict) -> Optional[Dict]:
5454

5555

5656
def _constructAuthors(meta: DocMeta) -> List[Dict]:
57-
return [_transformAuthor(author) for author in meta.authors_parsed]
57+
_authors = []
58+
for author in meta.authors_parsed:
59+
_author = _transformAuthor(author)
60+
if _author:
61+
_authors.append(_author)
62+
return _authors
5863

5964

6065
def _constructAuthorOwners(meta: DocMeta) -> List[Dict]:
61-
return [_transformAuthor(author) for author in meta.author_owners]
66+
_authors = []
67+
for author in meta.author_owners:
68+
_author = _transformAuthor(author)
69+
if _author:
70+
_authors.append(_author)
71+
return _authors
6272

6373

6474
def _getFirstSubDate(meta: DocMeta) -> Optional[str]:

0 commit comments

Comments
 (0)