Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Nov 2, 2024
1 parent 4be9a74 commit 6d63bb6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/translate/to_py_scalar_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import narwhals.stable.v1 as nw
from narwhals.dependencies import get_cudf
from tests.utils import PANDAS_VERSION


@pytest.mark.parametrize(
Expand All @@ -30,7 +31,6 @@
(np.datetime64("2020-01-01", "ms"), datetime(2020, 1, 1)),
(np.datetime64("2020-01-01", "us"), datetime(2020, 1, 1)),
(np.datetime64("2020-01-01", "ns"), datetime(2020, 1, 1)),
(pd.NA, None),
],
)
def test_to_py_scalar(
Expand All @@ -43,6 +43,13 @@ def test_to_py_scalar(
assert output == expected


@pytest.mark.skipif(
PANDAS_VERSION < (1,), reason="there was a (better?) time when there was no pd.NA"
)
def test_na_to_py_scalar() -> None:
assert nw.to_py_scalar(pd.NA) is None


@pytest.mark.parametrize(
"input_value",
[np.array([1, 2]), [1, 2, 3], {"a": [1, 2, 3]}],
Expand Down

0 comments on commit 6d63bb6

Please sign in to comment.