Skip to content

Commit

Permalink
drop _store_columns change
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Palazzo committed Sep 7, 2023
1 parent 18d48ad commit 43b2fa0
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions rdt/transformers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,25 +259,16 @@ def get_output_columns(self):
return list(self._get_output_to_property('sdtype'))

def _store_columns(self, columns, data):
"""Store the column names to be transformed.
if isinstance(columns, tuple) and columns not in data:
columns = list(columns)
elif not isinstance(columns, list):
columns = [columns]

Args:
columns (str, list, tuple):
Column name(s) to be transformed.
data (pandas.DataFrame):
The entire table.
"""
column_names = columns
if isinstance(column_names, tuple) and column_names not in data:
column_names = list(column_names)
elif not isinstance(column_names, list):
column_names = [column_names]

missing = set(column_names) - set(data.columns)
missing = set(columns) - set(data.columns)
if missing:
raise KeyError(f'Columns {missing} were not present in the data.')

self.columns = column_names
self.columns = columns

@staticmethod
def _get_columns_data(data, columns):
Expand Down

0 comments on commit 43b2fa0

Please sign in to comment.