def METHOD_NAME(self, X, y=None):
    """Fits imputer to data. 'None' values are converted to np.nan before imputation and are treated as the same.
    Args:
        X (pd.DataFrame or np.ndarray): the input training data of shape [n_samples, n_features]
        y (pd.Series, optional): the target training data of length [n_samples]
    Returns:
        self
    Raises:
        ValueError: if the KNNImputer receives a dataframe with both Boolean and Categorical data.
    """
    X = infer_feature_types(X)
    nan_ratio = X.isna().sum() / X.shape[0]
    # Keep track of the different types of data in X
    self._all_null_cols = nan_ratio[nan_ratio == 1].index.tolist()
    self._natural_language_cols = list(
        X.ww.select("NaturalLanguage", return_schema=True).columns.keys(),
    )
    # Only impute data that is not natural language columns or fully null
    self._cols_to_impute = [
        col
        for col in X.columns
        if col not in self._natural_language_cols and col not in self._all_null_cols
    ]
    # If the Dataframe only had natural language columns, do nothing.
    if not self._cols_to_impute:
        return self
    self._component_obj.METHOD_NAME(X[self._cols_to_impute], y)
    return self