From 6d63bb6f177140ad2fe9024a8c3bb1fc9577fca5 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sat, 2 Nov 2024 10:39:46 +0000 Subject: [PATCH] coverage --- tests/translate/to_py_scalar_test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/translate/to_py_scalar_test.py b/tests/translate/to_py_scalar_test.py index bd5cf136e..b13ba009e 100644 --- a/tests/translate/to_py_scalar_test.py +++ b/tests/translate/to_py_scalar_test.py @@ -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( @@ -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( @@ -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]}],