Skip to content

Commit 6218e97

Browse files
committed
Fixed typing in DocDetails.__add__
1 parent 26f7136 commit 6218e97

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/paperqa/types.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def __add__(self, other: DocDetails | int) -> DocDetails: # noqa: PLR0912
957957
if self.publication_date and other.publication_date:
958958
PREFER_OTHER = self.publication_date <= other.publication_date
959959

960-
merged_data = {}
960+
merged_data: dict[str, Any] = {}
961961
# pylint: disable-next=not-an-iterable # pylint bug: https://github.com/pylint-dev/pylint/issues/10144
962962
for field in type(self).model_fields:
963963
self_value = getattr(self, field)
@@ -997,11 +997,11 @@ def __add__(self, other: DocDetails | int) -> DocDetails: # noqa: PLR0912
997997
)
998998
else other.authors
999999
)
1000-
merged_data[field] = best_authors or None # type: ignore[assignment]
1000+
merged_data[field] = best_authors or None
10011001

10021002
elif field == "key" and self_value is not None and other_value is not None:
10031003
# if we have multiple keys, we wipe them and allow regeneration
1004-
merged_data[field] = None # type: ignore[assignment]
1004+
merged_data[field] = None
10051005

10061006
elif field in {"citation_count", "year", "publication_date"}:
10071007
# get the latest data
@@ -1034,7 +1034,7 @@ def __add__(self, other: DocDetails | int) -> DocDetails: # noqa: PLR0912
10341034
# Recalculate doc_id if doi has changed
10351035
if merged_data["doi"] != self.doi:
10361036
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
10381038
)
10391039

10401040
# Create and return new DocDetails instance

0 commit comments

Comments
 (0)