Skip to content

Commit

Permalink
Fix mypy annotation issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdlaird committed Oct 27, 2024
1 parent 2fc2f49 commit 927ab9d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion amazonorders/entity/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _parse_recipient(self) -> Recipient:
value = util.select_one(self.parsed, self.config.selectors.FIELD_ORDER_ADDRESS_FALLBACK_1_SELECTOR)

if value:
data_popover = value.get("data-a-popover", {}) # type: ignore[arg-type]
data_popover = value.get("data-a-popover", {}) # type: ignore[var-annotated]
inline_content = data_popover.get("inlineContent") # type: ignore[union-attr]
if inline_content:
value = BeautifulSoup(json.loads(inline_content), "html.parser")
Expand Down
6 changes: 6 additions & 0 deletions amazonorders/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ def get_order_history(self,
order: Order = self.config.order_cls(order_tag, self.config)

if full_details:
if not order.order_details_link:
logger.warning(f"order_details_link for Order {order.order_number} did not populate, "
f"cannot read full details.")

continue

self.amazon_session.get(order.order_details_link)
order_details_tag = util.select_one(self.amazon_session.last_response_parsed,
self.config.selectors.ORDER_DETAILS_ENTITY_SELECTOR)
Expand Down

0 comments on commit 927ab9d

Please sign in to comment.