Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/wintergrab/data/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
Loading