Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion giskard/push/perturbation.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def _apply_perturbation(
ds_slice_copy = ds_slice.copy()

# Apply the transformation
if col_type == SupportedPerturbationType.NUMERIC:
if col_type == SupportedPerturbationType.NUMERIC and ds.df.dtypes[feature] in ["int64", "float64"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about int32, float32, etc.?

I think this https://pandas.pydata.org/docs/reference/api/pandas.api.types.is_datetime64_any_dtype.html would be better

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up using https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.api.types.is_any_real_numeric_dtype.html which is more robust.

As it will exclude all non-real numeric data type so we don't end up with the same issue with another pseudo-numeric data type.

passed = _numeric(
ds,
ds_slice,
Expand Down