diff --git a/evalml/pipelines/components/transformers/imputers/simple_imputer.py b/evalml/pipelines/components/transformers/imputers/simple_imputer.py index 446fd78cd2..35c93adcbd 100644 --- a/evalml/pipelines/components/transformers/imputers/simple_imputer.py +++ b/evalml/pipelines/components/transformers/imputers/simple_imputer.py @@ -93,7 +93,7 @@ def fit(self, X, y=None): return self X = X[self._cols_to_impute] - if (X.dtypes is bool).all(): + if (X.dtypes == bool).all(): # Ensure that _component_obj still gets fit so that if any of the dtypes are different # at transform, we've fit the component. This is needed because sklearn doesn't allow # data with only bool dtype to be passed in. @@ -119,7 +119,7 @@ def transform(self, X, y=None): # separate out just the columns we are imputing X_t = X[self._cols_to_impute] - if not self._cols_to_impute or (X_t.dtypes is bool).all(): + if not self._cols_to_impute or (X_t.dtypes == bool).all(): # If there are no columns to impute or all columns to impute are bool dtype, # which will never have null values, return the original data without any fully null columns not_all_null_cols = [ diff --git a/evalml/pipelines/components/transformers/imputers/target_imputer.py b/evalml/pipelines/components/transformers/imputers/target_imputer.py index 87ab4bbfd1..458f9b858b 100644 --- a/evalml/pipelines/components/transformers/imputers/target_imputer.py +++ b/evalml/pipelines/components/transformers/imputers/target_imputer.py @@ -95,7 +95,7 @@ def fit(self, X, y): y = y.to_frame() # Return early if all the columns are bool dtype, which will never have null values - if (y.dtypes is bool).all(): + if (y.dtypes == bool).all(): return y self._component_obj.fit(y) @@ -119,7 +119,7 @@ def transform(self, X, y): y_df = y_ww.ww.to_frame() # Return early if all the columns are bool dtype, which will never have null values - if (y_df.dtypes is bool).all(): + if (y_df.dtypes == bool).all(): return X, y_ww transformed = self._component_obj.transform(y_df) diff --git a/pyproject.toml b/pyproject.toml index 1a26073519..d72780bec0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -163,7 +163,7 @@ lint.select = [ # isort "I001" ] -lint.ignore = ["E501", "D107", "D401"] +lint.ignore = ["E501", "D107", "D401", "E721"] src = ["evalml"] [tool.ruff.lint.per-file-ignores]