Error encoding categorical features using sklearn pipelines
In this line:

("impute_stage", Imputer(missing_values=np.nan, strategy="median"))


Because your input type is string, you shouldn't fill the null value to median (we cannot average string value).

From the document, you can fill null value with a string constant like:

Imputer(missing_values=None, strategy="constant", fill_value="NULL")


to represent null value in your string field.