Skip to content

Commit

Permalink
[AIR][Serve] Add windows check for pd.DataFrame comparison ray-projec…
Browse files Browse the repository at this point in the history
…t#26889

n previous implementation ray-project#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 <[email protected]>
  • Loading branch information
jiaodong authored and Rohan138 committed Jul 28, 2022
1 parent ba3aa20 commit b476070
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/ray/serve/tests/test_air_integrations.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import tempfile
from typing import Optional

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit b476070

Please sign in to comment.