sklearn - SimpleImputer in an empty Pipeline
All(?) the sklearn transformers do a check on input data (check_X_y), which includes a check for an empty dataframe.  You could probably monkey-patch out that check, but that seems like overkill.

Instead, ColumnTransformer seems the way to go.  Its main purpose fits your situation.  It deals with an empty columns selector gracefully, by just not calling fit on that transformer:


  transformers_ : list
  The collection of fitted transformers... In case there were no columns selected, this will be the unfitted transformer.


Unless you're removing columns earlier in the pipeline?  In that case, please provide that additional context.