MAINT clarifications in ColumnTransformer._update_transformers
@@ -290,22 +290,25 @@ boolean mask array
return feature_names
def _update_fitted_transformers(self, transformers):
+ # transformers are fitted; excludes 'drop' cases
transformers = iter(transformers)
transformers_ = []
for name, old, column in self.transformers:
if old == 'drop':
- trans = old
+ trans = 'drop'
elif old == 'passthrough':
# FunctionTransformer is present in list of transformers,
# so get next transformer, but save original string
next(transformers)
- trans = old
+ trans = 'passthrough'
else:
trans = next(transformers)
transformers_.append((name, trans, column))
+ # sanity check that transformers is exhausted
+ assert not list(transformers)
self.transformers_ = transformers_
def _validate_output(self, result):
