Skip to content

Commit 8521122

Browse files
authored
fix minor bug in feature test (microsoft#531)
1 parent f3ed911 commit 8521122

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

rdagent/components/coder/data_science/feature/eval_tests/feature_test.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ assert get_width(X) == get_width(
5656
if isinstance(X, pd.DataFrame) and isinstance(X_test, pd.DataFrame):
5757
assert get_column_list(X) == get_column_list(X_test), "Mismatch in column names of training and test data."
5858

59-
assert sorted(X.dtypes.unique().tolist()) == sorted(
60-
X_loaded.dtypes.unique().tolist()
61-
), f"feature engineering has produced new data types which is not allowed, data loader data types are {X_loaded.dtypes.unique().tolist()} and feature engineering data types are {X.dtypes.unique().tolist()}"
62-
63-
print("Feature Engineering test passed successfully. All checks including length, width, and data types have been validated.")
59+
if isinstance(X, pd.DataFrame):
60+
assert sorted(X.dtypes.unique().tolist()) == sorted(
61+
X_loaded.dtypes.unique().tolist()
62+
), f"feature engineering has produced new data types which is not allowed, data loader data types are {X_loaded.dtypes.unique().tolist()} and feature engineering data types are {X.dtypes.unique().tolist()}"
63+
64+
print(
65+
"Feature Engineering test passed successfully. All checks including length, width, and data types have been validated."
66+
)

0 commit comments

Comments
 (0)