I am using a custom transformer inside sklearn pipeline. The transformer removes lines from data set, but it seems it can only remove the lines from X, but not from y. I see the pipeline automatically calls fit_transform method of the transformer. Current implementation of sklearn 1.2 TransformerMixin method fit_transform calls fit(X, y) and then transform(X) Pipeline object in method transform also returns only X, not y. It seems to me a Transformer cannot really modify y.
What is the correct way to remove a line from both X and y sets inside Pipeline if not by Transformer?