Data quality and preparation
Cleaning is done once, before the split, on the whole dataset: duplicates, impossible values, columns you will not use. Preprocessing (impute, encode, scale) learns something from data, so it goes inside the pipeline and learns from training rows only.
ExampleRemoving the 22 duplicate rows is cleaning; filling missing charges with the training median is preprocessing.
