diff --git a/pandas_schema/schema.py b/pandas_schema/schema.py index 5c0442e..50355c8 100644 --- a/pandas_schema/schema.py +++ b/pandas_schema/schema.py @@ -60,7 +60,9 @@ def validate(self, df: pd.DataFrame, columns: typing.List[str] = None) -> typing columns_to_pair = [column for column in self.columns if column.name in columns] else: raise PanSchArgumentError( - 'Columns {} passed in are not part of the schema'.format(set(columns).difference(self.columns)) + 'Columns {} passed in are not part of the schema'.format(set(columns).difference( + self.get_column_names() + )) ) # We associate the column objects in the schema with data frame series either by name or by position, depending