Do not suggest logging dropped items twice (#6448)

Co-authored-by: Kevin Lloyd Bernal <kevinoxy@gmail.com>
This commit is contained in:
Adrián Chaves 2024-07-31 11:37:19 +02:00 committed by GitHub
parent e376c0b31a
commit 03a15ced4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ contain a price:
adapter["price"] = adapter["price"] * self.vat_factor
return item
else:
raise DropItem(f"Missing price in {item}")
raise DropItem("Missing price")
Write items to a JSON lines file
@ -254,7 +254,7 @@ returns multiples items with the same id:
def process_item(self, item, spider):
adapter = ItemAdapter(item)
if adapter["id"] in self.ids_seen:
raise DropItem(f"Duplicate item found: {item!r}")
raise DropItem(f"Item ID already seen: {adapter['id']}")
else:
self.ids_seen.add(adapter["id"])
return item