Skip to content

Commit

Permalink
Test other null values
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jul 3, 2024
1 parent a67e42e commit c7a9560
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions py-polars/tests/unit/interop/test_from_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,11 @@ def test_from_pandas_nan_to_null_16453(monkeypatch: pytest.MonkeyPatch) -> None:
assert_frame_equal(result, expected)


def test_from_pandas_natype_17355() -> None:
@pytest.mark.parametrize("null", [pd.NA, np.nan, None, float("nan")])
def test_from_pandas_string_with_natype_17355(null: Any) -> None:
# https://github.com/pola-rs/polars/issues/17355

pd_df = pd.DataFrame({"col": ["a", pd.NA]})
pd_df = pd.DataFrame({"col": ["a", null]})
result = pl.from_pandas(pd_df)
expected = pl.DataFrame({"col": ["a", None]})
assert_frame_equal(result, expected)

0 comments on commit c7a9560

Please sign in to comment.