When building a Pipeline I'm ending up at a scenario that can be simplified like this:
FeatureUnion(NumericalPipeline(steps), CategoricalPipeline(steps))
Since this is one intermediary step in a larger Pipeline, I'm feeding the preceding inputs into both of these and select the corresponding dtypes within the Numerical and Categorical Pipelines.
For some datasets, however, no Categorical Columns are left leading the Pipeline to fail. I've tried returning an empty list and 'None' but both of these did not result in the Pipeline skipping the "empty" CategoricalPipeline.
After further investigation it turns out that the SimpleImputer() in the CategoricalPipeline causes the error. Depending on the order of steps the following messages are shown:
ValueError: Found array with 0 feature(s) (shape=(150, 0)) while a minimum of 1 is required.
ValueError: at least one array or dtype is required
Any ideas on how to pass the Imputer when no Column is present?