From 9489b87a7e82cd3b765015a89a9ecfb95581ad4c Mon Sep 17 00:00:00 2001 From: Justus Kuhlmann <82444481+jkuhl-uni@users.noreply.github.com> Date: Thu, 1 Jun 2023 15:07:16 +0200 Subject: [PATCH] fix nan to None test (#192) --- tests/pandas_test.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/pandas_test.py b/tests/pandas_test.py index 3a02b97e..f86458f8 100644 --- a/tests/pandas_test.py +++ b/tests/pandas_test.py @@ -46,10 +46,9 @@ def test_nan_df_export_import(tmp_path): my_df.loc[1, "int"] = np.nan for gz in [True, False]: - pe.input.pandas.dump_df(my_df, (tmp_path / 'df_output').as_posix(), gz=gz) - reconstructed_df = pe.input.pandas.load_df((tmp_path / 'df_output').as_posix(), auto_gamma=True, gz=gz) with pytest.warns(UserWarning, match="nan value in column int will be replaced by None"): - warnings.warn("nan value in column int will be replaced by None", UserWarning) + pe.input.pandas.dump_df(my_df, (tmp_path / 'df_output').as_posix(), gz=gz) + reconstructed_df = pe.input.pandas.load_df((tmp_path / 'df_output').as_posix(), auto_gamma=True, gz=gz) assert reconstructed_df.loc[1, "int"] is None assert np.all(reconstructed_df.loc[:, "float"] == my_df.loc[:, "float"]) assert np.all(reconstructed_df.loc[:, "Obs1"] == my_df.loc[:, "Obs1"])