Skip to content

Commit

Permalink
Closes #100: exclude_columns not working for ColumnsBasedPipelineStage
Browse files Browse the repository at this point in the history
  • Loading branch information
shaypal5 committed May 12, 2022
1 parent b0f84bc commit a382412
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pdpipe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,8 @@ def __init__(
none_columns='error', **kwargs):
self._exclude_columns = exclude_columns
if exclude_columns:
self._exclude_columns = self._interpret_columns_param(
exclude_columns)
self._exclude_columns, self._exc_col_str = \
self._interpret_columns_param(exclude_columns)
self._none_error = False
self._none_cols = None
# handle none_columns
Expand All @@ -625,13 +625,14 @@ def __init__(
# done handling none_columns
self._col_arg, self._col_str = self._interpret_columns_param(
columns, self._none_error, none_columns=self._none_cols)
self._final_col_str = '{self._col_str} (except {self._exc_col_str})'
if (kwargs.get('desc') is None) and desc_temp:
kwargs['desc'] = desc_temp.format(self._col_str)
kwargs['desc'] = desc_temp.format(self._final_col_str)
if kwargs.get('exmsg') is None:
kwargs['exmsg'] = (
'Pipeline stage failed because not all columns {} '
'were found in the input dataframe.'
).format(self._col_str)
).format(self._final_col_str)
super().__init__(**kwargs)

def _is_fittable(self):
Expand Down

0 comments on commit a382412

Please sign in to comment.