Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled perturbation on date #1932

Merged
merged 5 commits into from
May 17, 2024
Merged

Conversation

kevinmessiaen
Copy link
Member

Description

Disabled perturbation on date

Related Issue

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

@@ -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
Member

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.

@rabah-khalek rabah-khalek enabled auto-merge (squash) May 17, 2024 11:28
Copy link

sonarcloud bot commented May 17, 2024

@rabah-khalek rabah-khalek merged commit f1c1a8f into main May 17, 2024
16 checks passed
@rabah-khalek rabah-khalek deleted the bug/disabled_perturbation_on_date branch May 17, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants