Skip to content

Commit be72ad0

Browse files
Fix test_process_features float conversion
The conversion from float to string lost the behavior of tolerating small deltas due to floating point arithmetic error. Convert back to a float before comparison in order to get the tolerance back.
1 parent 5a23a44 commit be72ad0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/morpheus_dfp/stages/test_dfp_preprocessing_stage.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def test_process_features(
4949

5050
expected_df = control_message.payload().copy_dataframe()
5151
expected_df['v210'] = expected_df['v2'] + 10
52-
expected_df['v3'] = expected_df['v3'].astype(str)
5352

5453
schema = DataFrameInputSchema(column_info=[
5554
CustomColumn(name='v210', dtype=str, process_column_fn=lambda df: df['v2'] + 10),
@@ -60,4 +59,6 @@ def test_process_features(
6059
results = stage.process_features(control_message)
6160

6261
assert isinstance(results, ControlMessage)
63-
dataset_pandas.assert_compare_df(results.payload().get_data(), expected_df)
62+
data = results.payload().get_data()
63+
data['v3'] = data['v3'].astype(float)
64+
dataset_pandas.assert_compare_df(data, expected_df)

0 commit comments

Comments
 (0)