# Is it possible that GridSearchCV make the test data leakage?

I have 1000+ records of dataset. After I clean all the training data then I perform the GridSearchCV library to the training data. So the cleaning step that I've done is filling some missing value and I use mean of entire training data. But in GridSearchCV it splitting the training set and test set to perform k-fold cross validation. So this meant GridSearhCV make the test data leakage? Because I think that I fill the mean by using entire training data. But in practical I think we should not use training data to fill the missing value of testing data.

I'm not sure if this can be done with a convenience method like GridSearchCV. I tend to avoid those tools, since they are almost by definition less flexible than writing your own code.