From b476070d63dd71d9dcb6ce1293494f9cb925ffa4 Mon Sep 17 00:00:00 2001 From: Jiao Date: Fri, 22 Jul 2022 12:36:40 -0700 Subject: [PATCH] [AIR][Serve] Add windows check for pd.DataFrame comparison #26889 n previous implementation #26821 we have windows failure suggesting we behave differently on windows regarding datatype conversion. In our https://sourcegraph.com/github.com/ray-project/ray/-/blob/python/ray/data/tests/test_dataset.py?L577 regarding use of TensorArray we seem to rely on pd'sassert_frame_equal rather than manually comparing frames. This PR adds a quick conditional on windows only to ignore dtype for now. Signed-off-by: Rohan138 --- python/ray/serve/tests/test_air_integrations.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/python/ray/serve/tests/test_air_integrations.py b/python/ray/serve/tests/test_air_integrations.py index b0a222a69879..3ec434424371 100644 --- a/python/ray/serve/tests/test_air_integrations.py +++ b/python/ray/serve/tests/test_air_integrations.py @@ -1,3 +1,4 @@ +import os import tempfile from typing import Optional @@ -90,8 +91,13 @@ def test_dataframe_with_tensorarray(self): unpacked_list = BatchingManager.split_dataframe(batched_df, 1) assert len(unpacked_list) == 1 - assert unpacked_list[0]["a"].equals(split_df["a"]) - assert unpacked_list[0]["b"].equals(split_df["b"]) + # On windows, conversion dtype is not preserved. + check_dtype = not os.name == "nt" + pd.testing.assert_frame_equal( + unpacked_list[0].reset_index(drop=True), + split_df.reset_index(drop=True), + check_dtype=check_dtype, + ) class AdderPredictor(Predictor):