Skip to content

Commit 41e034a

Browse files
committed
Removed content_hash wipe if only one is present, as this is overly stateful to __add__
1 parent cc6767d commit 41e034a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/paperqa/types.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,11 +1232,12 @@ def __add__(self, other: DocDetails | int) -> DocDetails: # noqa: PLR0912
12321232
merged_data[field] = max(self_value, other_value)
12331233
elif field == "content_hash" and (
12341234
# Hashes are both present but differ
1235-
(self_value and other_value and self_value != other_value)
1236-
# One hash is explicitly disabled (not autopopulated)
1237-
or (self_value is None or other_value is None)
1235+
self_value
1236+
and other_value
1237+
and self_value != other_value
12381238
):
1239-
# We don't know which to pick, so just discard the value
1239+
# If hashes are both present but differ,
1240+
# we don't know which to pick, so just discard the value
12401241
merged_data[field] = None
12411242

12421243
else:

0 commit comments

Comments
 (0)