Skip to content

Commit

Permalink
Fix handling of customAttributes sub-items.
Browse files Browse the repository at this point in the history
  • Loading branch information
wRAR committed Dec 24, 2024
1 parent 719b841 commit 1327741
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zyte_common_items/pipelines.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from copy import deepcopy
from warnings import warn

from zyte_common_items import CustomAttributes, ae
from zyte_common_items import ae


class AEPipeline:
Expand Down Expand Up @@ -137,7 +137,8 @@ def process_item(self, item, spider):
# instead of dropping the whole result
new_item = {}
for item_type, sub_item in item.items():
if item_type is CustomAttributes:
if item_type == "customAttributes":
new_item[item_type] = sub_item
continue
threshold = self.get_threshold_for_item(sub_item, spider)
if self._process_probability(sub_item, threshold):
Expand Down

0 comments on commit 1327741

Please sign in to comment.