Skip to content

Commit

Permalink
fix: to_py_scalar was raising for decimals
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Jan 11, 2025
1 parent 346724e commit 1d5c57f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions narwhals/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from datetime import datetime
from datetime import timedelta
from decimal import Decimal
from functools import wraps
from typing import TYPE_CHECKING
from typing import Any
Expand Down Expand Up @@ -59,6 +60,7 @@
int,
float,
complex,
Decimal,
)


Expand Down
2 changes: 2 additions & 0 deletions tests/translate/to_py_scalar_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from datetime import datetime
from datetime import timedelta
from decimal import Decimal
from typing import Any

import numpy as np
Expand All @@ -20,6 +21,7 @@
(1, 1),
(pa.scalar(1), 1),
(np.int64(1), 1),
(Decimal("1.1"), Decimal("1.1")),
(1.0, 1.0),
(None, None),
("a", "a"),
Expand Down

0 comments on commit 1d5c57f

Please sign in to comment.