@@ -957,7 +957,7 @@ def __add__(self, other: DocDetails | int) -> DocDetails: # noqa: PLR0912
957
957
if self .publication_date and other .publication_date :
958
958
PREFER_OTHER = self .publication_date <= other .publication_date
959
959
960
- merged_data = {}
960
+ merged_data : dict [ str , Any ] = {}
961
961
# pylint: disable-next=not-an-iterable # pylint bug: https://github.com/pylint-dev/pylint/issues/10144
962
962
for field in type (self ).model_fields :
963
963
self_value = getattr (self , field )
@@ -997,11 +997,11 @@ def __add__(self, other: DocDetails | int) -> DocDetails: # noqa: PLR0912
997
997
)
998
998
else other .authors
999
999
)
1000
- merged_data [field ] = best_authors or None # type: ignore[assignment]
1000
+ merged_data [field ] = best_authors or None
1001
1001
1002
1002
elif field == "key" and self_value is not None and other_value is not None :
1003
1003
# if we have multiple keys, we wipe them and allow regeneration
1004
- merged_data [field ] = None # type: ignore[assignment]
1004
+ merged_data [field ] = None
1005
1005
1006
1006
elif field in {"citation_count" , "year" , "publication_date" }:
1007
1007
# get the latest data
@@ -1034,7 +1034,7 @@ def __add__(self, other: DocDetails | int) -> DocDetails: # noqa: PLR0912
1034
1034
# Recalculate doc_id if doi has changed
1035
1035
if merged_data ["doi" ] != self .doi :
1036
1036
merged_data ["doc_id" ] = (
1037
- encode_id (merged_data ["doi" ].lower ()) if merged_data ["doi" ] else None # type: ignore[attr-defined,assignment]
1037
+ encode_id (merged_data ["doi" ].lower ()) if merged_data ["doi" ] else None
1038
1038
)
1039
1039
1040
1040
# Create and return new DocDetails instance
0 commit comments