@@ -1052,7 +1052,7 @@ def __add__(self, other: DocDetails | int) -> DocDetails: # noqa: PLR0912
1052
1052
if self .publication_date and other .publication_date :
1053
1053
PREFER_OTHER = self .publication_date <= other .publication_date
1054
1054
1055
- merged_data = {}
1055
+ merged_data : dict [ str , Any ] = {}
1056
1056
# pylint: disable-next=not-an-iterable # pylint bug: https://github.com/pylint-dev/pylint/issues/10144
1057
1057
for field in type (self ).model_fields :
1058
1058
self_value = getattr (self , field )
@@ -1092,11 +1092,11 @@ def __add__(self, other: DocDetails | int) -> DocDetails: # noqa: PLR0912
1092
1092
)
1093
1093
else other .authors
1094
1094
)
1095
- merged_data [field ] = best_authors or None # type: ignore[assignment]
1095
+ merged_data [field ] = best_authors or None
1096
1096
1097
1097
elif field == "key" and self_value is not None and other_value is not None :
1098
1098
# if we have multiple keys, we wipe them and allow regeneration
1099
- merged_data [field ] = None # type: ignore[assignment]
1099
+ merged_data [field ] = None
1100
1100
1101
1101
elif field in {"citation_count" , "year" , "publication_date" }:
1102
1102
# get the latest data
@@ -1129,7 +1129,7 @@ def __add__(self, other: DocDetails | int) -> DocDetails: # noqa: PLR0912
1129
1129
# Recalculate doc_id if doi has changed
1130
1130
if merged_data ["doi" ] != self .doi :
1131
1131
merged_data ["doc_id" ] = (
1132
- encode_id (merged_data ["doi" ].lower ()) if merged_data ["doi" ] else None # type: ignore[attr-defined,assignment]
1132
+ encode_id (merged_data ["doi" ].lower ()) if merged_data ["doi" ] else None
1133
1133
)
1134
1134
1135
1135
# Create and return new DocDetails instance
0 commit comments