From bb652cbed97a9f5b2bacf20457d95ffa00ff2152 Mon Sep 17 00:00:00 2001 From: harshitkrhere <240125949+harshitkrhere@users.noreply.github.com> Date: Mon, 23 Nov 2026 08:12:40 +0000 Subject: [PATCH 1/2] Initial plan From 25a9fca1f7043fadfc99797640e108c2b08eb67f Mon Sep 17 00:00:00 2001 From: harshitkrhere <240125949+harshitkrhere@users.noreply.github.com> Date: Mon, 23 Nov 2026 08:15:37 +0000 Subject: [PATCH 2/2] Combine nested currency conversion condition Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- src/wintergrab/data/pipeline.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wintergrab/data/pipeline.py b/src/wintergrab/data/pipeline.py index 4e3fc5f..beaa420 100644 --- a/src/wintergrab/data/pipeline.py +++ b/src/wintergrab/data/pipeline.py @@ -1706,9 +1706,12 @@ def apply(self, record: dict[str, Any], ctx: RecordContext) -> dict[str, Any] | code = value.get("currency") or record_currency if not self._same(code): changes[field] = {**value, "amount": self._convert(value["amount"], code), "currency": self.to} - elif isinstance(value, (int, float, Decimal)) and not isinstance(value, bool): - if not self._same(record_currency): - changes[field] = self._convert(value, record_currency) + elif ( + isinstance(value, (int, float, Decimal)) + and not isinstance(value, bool) + and not self._same(record_currency) + ): + changes[field] = self._convert(value, record_currency) except (LookupError, InvalidOperation) as exc: self.error(str(exc)) if self.on_error == "raise":